Class SSLOptions
java.lang.Object
io.vertx.core.net.SSLOptions
- Direct Known Subclasses:
ClientSSLOptions, ServerSSLOptions
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe default ENABLED_SECURE_TRANSPORT_PROTOCOLS value = { "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" }static final longThe default value of SSL handshake timeout = 10static final TimeUnitDefault SSL handshake time unit = SECONDSstatic final booleanDefault use alpn = falsestatic final booleanDefault use hybrid = false -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorSSLOptions(JsonObject json) Create options from JSONSSLOptions(SSLOptions other) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionaddCrlPath(String crlPath) Add a CRL pathaddCrlValue(Buffer crlValue) Add a CRL valueaddEnabledCipherSuite(String suite) Add an enabled cipher suite, appended to the ordered suites.addEnabledSecureTransportProtocol(String protocol) Add an enabled SSL/TLS protocols, appended to the ordered protocols.copy()booleanGet the CRL valuesReturn an ordered set of the cipher suites.Returns the enabled SSL/TLS protocolslonginthashCode()protected voidinit()booleanbooleanremoveEnabledCipherSuite(String suite) Removes an enabled cipher suite from the ordered suites.removeEnabledSecureTransportProtocol(String protocol) Removes an enabled SSL/TLS protocol from the ordered protocols.setApplicationLayerProtocols(List<String> protocols) Set the list of application-layer protocols to provide to the server during the Application-Layer Protocol Negotiation.setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols) Sets the list of enabled SSL/TLS protocols.setKeyCertOptions(KeyCertOptions options) Set the key/cert options.setSslHandshakeTimeout(long sslHandshakeTimeout) Set the SSL handshake timeout, default time unit is seconds.setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit) Set the SSL handshake timeout unit.setTrustOptions(TrustOptions options) Set the trust options.setUseAlpn(boolean useAlpn) Set the ALPN usage.setUseHybridKeyExchangeProtocol(boolean useHybridKeyExchangeProtocol) Enable or disable the hybrid post-quantum key exchange protocol X25519MLKEM768.toJson()Convert to JSON
-
Field Details
-
DEFAULT_USE_ALPN
public static final boolean DEFAULT_USE_ALPNDefault use alpn = false- See Also:
-
DEFAULT_USE_HYBRID
public static final boolean DEFAULT_USE_HYBRIDDefault use hybrid = false- See Also:
-
DEFAULT_SSL_HANDSHAKE_TIMEOUT
public static final long DEFAULT_SSL_HANDSHAKE_TIMEOUTThe default value of SSL handshake timeout = 10- See Also:
-
DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT
Default SSL handshake time unit = SECONDS -
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS
The default ENABLED_SECURE_TRANSPORT_PROTOCOLS value = { "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" } SSLv3 is NOT enabled due to POODLE vulnerability http://en.wikipedia.org/wiki/POODLE "SSLv2Hello" is NOT enabled since it's disabled by default since JDK7
-
-
Constructor Details
-
SSLOptions
public SSLOptions()Default constructor -
SSLOptions
-
SSLOptions
-
-
Method Details
-
init
protected void init() -
copy
-
getKeyCertOptions
- Returns:
- the key/cert options
-
setKeyCertOptions
Set the key/cert options.- Parameters:
options- the key store options- Returns:
- a reference to this, so the API can be used fluently
-
getTrustOptions
- Returns:
- the trust options
-
setTrustOptions
Set the trust options.- Parameters:
options- the trust options- Returns:
- a reference to this, so the API can be used fluently
-
addEnabledCipherSuite
Add an enabled cipher suite, appended to the ordered suites.- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
removeEnabledCipherSuite
Removes an enabled cipher suite from the ordered suites.- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
-
getEnabledCipherSuites
Return an ordered set of the cipher suites.The set is initially empty and suite should be added to this set in the desired order.
When suites are added and therefore the list is not empty, it takes precedence over the default suite defined by the
SSLEngineOptionsin use.- Returns:
- the enabled cipher suites
-
getCrlPaths
-
addCrlPath
Add a CRL path- Parameters:
crlPath- the path- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
getCrlValues
-
addCrlValue
Add a CRL value- Parameters:
crlValue- the value- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
isUseAlpn
public boolean isUseAlpn()- Returns:
- whether to use or not Application-Layer Protocol Negotiation
-
setUseAlpn
Set the ALPN usage.- Parameters:
useAlpn- true when Application-Layer Protocol Negotiation should be used
-
isUseHybridKeyExchangeProtocol
public boolean isUseHybridKeyExchangeProtocol()- Returns:
- whether the hybrid key exchange protocol X25519MLKEM768 is enabled
-
setUseHybridKeyExchangeProtocol
Enable or disable the hybrid post-quantum key exchange protocol X25519MLKEM768.When enabled, TLS connections will use X25519MLKEM768 for key exchange, providing protection against quantum computer attacks.
This feature requires OpenSSL and will not work with the JDK SSL engine. You must:
- Use
OpenSSLEngineOptionsas the SSL engine - Have
io.netty:netty-tcnative-classeson the classpath - Have an OpenSSL provider (e.g.
io.smallrye:smallrye-openssl) on the classpath
- Parameters:
useHybridKeyExchangeProtocol-trueto enable hybrid key exchange- Returns:
- a reference to this, so the API can be used fluently
- Use
-
getEnabledSecureTransportProtocols
-
getSslHandshakeTimeout
public long getSslHandshakeTimeout()- Returns:
- the SSL handshake timeout, in time unit specified by
getSslHandshakeTimeoutUnit().
-
setSslHandshakeTimeout
Set the SSL handshake timeout, default time unit is seconds.- Parameters:
sslHandshakeTimeout- the SSL handshake timeout to set, in milliseconds- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeoutUnit
Set the SSL handshake timeout unit. If not specified, default is seconds.- Parameters:
sslHandshakeTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
getSslHandshakeTimeoutUnit
- Returns:
- the SSL handshake timeout unit.
-
setEnabledSecureTransportProtocols
Sets the list of enabled SSL/TLS protocols.- Parameters:
enabledSecureTransportProtocols- the SSL/TLS protocols to enable- Returns:
- a reference to this, so the API can be used fluently
-
addEnabledSecureTransportProtocol
Add an enabled SSL/TLS protocols, appended to the ordered protocols.- Parameters:
protocol- the SSL/TLS protocol to enable- Returns:
- a reference to this, so the API can be used fluently
-
removeEnabledSecureTransportProtocol
Removes an enabled SSL/TLS protocol from the ordered protocols.- Parameters:
protocol- the SSL/TLS protocol to disable- Returns:
- a reference to this, so the API can be used fluently
-
getApplicationLayerProtocols
-
setApplicationLayerProtocols
Set the list of application-layer protocols to provide to the server during the Application-Layer Protocol Negotiation.- Parameters:
protocols- the protocols- Returns:
- a reference to this, so the API can be used fluently
-
equals
-
hashCode
-
toJson
-