Top Description Fields Constructors Methods
io.vertx.core.net

public Class SSLOptions

extends Object
Class Inheritance
Annotations
@DataObject
@JsonGen
publicConverter:false
Imports
io.vertx.codegen.annotations.DataObject, .GenIgnore, io.vertx.codegen.json.annotations.JsonGen, io.vertx.core.buffer.Buffer, io.vertx.core.json.JsonObject, java.util.ArrayList, .Arrays, .Collections, .LinkedHashSet, .List, .Objects, .Set, java.util.concurrent.TimeUnit

SSL options
Author
Tim Fox

Field Summary

Modifier and TypeField and Description
private ArrayList<String>
private ArrayList<Buffer>
public static final List<String>
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

public static final long
DEFAULT_SSL_HANDSHAKE_TIMEOUT

The default value of SSL handshake timeout = 10

public static final TimeUnit
DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT

Default SSL handshake time unit = SECONDS

public static final boolean
DEFAULT_USE_ALPN

Default use alpn = false

private Set<String>
private Set<String>
private KeyCertOptions
private long
private TimeUnit
private TrustOptions
private boolean

Constructor Summary

AccessConstructor and Description
public
SSLOptions(JsonObject
the JSON
json
)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Create options from JSON

public
SSLOptions()

Default constructor

public
SSLOptions(SSLOptions
the options to copy
other
)

Copy constructor

Method Summary

Modifier and TypeMethod and Description
public SSLOptions

Returns:

a reference to this, so the API can be used fluently
addCrlPath
(String
the path
crlPath
)

Add a CRL path

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
addCrlValue
(Buffer
the value
crlValue
)
References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Add a CRL value

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
addEnabledCipherSuite
(String
the suite
suite
)

Add an enabled cipher suite, appended to the ordered suites.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
addEnabledSecureTransportProtocol
(String
the SSL/TLS protocol to enable
protocol
)

Add an enabled SSL/TLS protocols, appended to the ordered protocols.

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public List<String>

Returns:

the CRL (Certificate revocation list) paths
getCrlPaths
()

public List<Buffer>

Returns:

the list of values
getCrlValues
()

Get the CRL values

public Set<String>

Returns:

the enabled cipher suites
getEnabledCipherSuites
()

Return an ordered set of the cipher suites.

public Set<String>

Returns:

the enabled protocols
getEnabledSecureTransportProtocols
()

Returns the enabled SSL/TLS protocols

public KeyCertOptions

Returns:

the key/cert options
getKeyCertOptions
()

public long

Returns:

the SSL handshake timeout, in time unit specified by getSslHandshakeTimeoutUnit().
getSslHandshakeTimeout
()

public TimeUnit

Returns:

the SSL handshake timeout unit.
getSslHandshakeTimeoutUnit
()

public TrustOptions

Returns:

the trust options
getTrustOptions
()

private void
init()

public boolean

Returns:

whether to use or not Application-Layer Protocol Negotiation
isUseAlpn
()

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
removeEnabledCipherSuite
(String
the suite
suite
)

Removes an enabled cipher suite from the ordered suites.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
removeEnabledSecureTransportProtocol
(String
the SSL/TLS protocol to disable
protocol
)

Removes an enabled SSL/TLS protocol from the ordered protocols.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
setEnabledSecureTransportProtocols
(Set<String>
the SSL/TLS protocols to enable
enabledSecureTransportProtocols
)

Sets the list of enabled SSL/TLS protocols.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
setKeyCertOptions
(KeyCertOptions
the key store options
options
)

Set the key/cert options.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
setSslHandshakeTimeout
(long
the SSL handshake timeout to set, in milliseconds
sslHandshakeTimeout
)

Set the SSL handshake timeout, default time unit is seconds.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
setSslHandshakeTimeoutUnit
(TimeUnit
specify time unit.
sslHandshakeTimeoutUnit
)

Set the SSL handshake timeout unit.

public SSLOptions

Returns:

a reference to this, so the API can be used fluently
setTrustOptions
(TrustOptions
the trust options
options
)

Set the trust options.

public SSLOptions
setUseAlpn(boolean
true when Application-Layer Protocol Negotiation should be used
useAlpn
)

Set the ALPN usage.

public JsonObject

Returns:

the JSON
toJson
()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Convert to JSON

Inherited from java.lang.Object:
clonefinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

crlPathsback to summary
private ArrayList<String> crlPaths
crlValuesback to summary
private ArrayList<Buffer> crlValues
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLSback to summary
public static final List<String> 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

DEFAULT_SSL_HANDSHAKE_TIMEOUTback to summary
public static final long DEFAULT_SSL_HANDSHAKE_TIMEOUT

The default value of SSL handshake timeout = 10

DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNITback to summary
public static final TimeUnit DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT

Default SSL handshake time unit = SECONDS

DEFAULT_USE_ALPNback to summary
public static final boolean DEFAULT_USE_ALPN

Default use alpn = false

enabledCipherSuitesback to summary
private Set<String> enabledCipherSuites
enabledSecureTransportProtocolsback to summary
private Set<String> enabledSecureTransportProtocols
keyCertOptionsback to summary
private KeyCertOptions keyCertOptions
sslHandshakeTimeoutback to summary
private long sslHandshakeTimeout
sslHandshakeTimeoutUnitback to summary
private TimeUnit sslHandshakeTimeoutUnit
trustOptionsback to summary
private TrustOptions trustOptions
useAlpnback to summary
private boolean useAlpn

Constructor Detail

SSLOptionsback to summary
public SSLOptions(JsonObject json)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Create options from JSON

Parameters
json:JsonObject

the JSON

SSLOptionsback to summary
public SSLOptions()

Default constructor

SSLOptionsback to summary
public SSLOptions(SSLOptions other)

Copy constructor

Parameters
other:SSLOptions

the options to copy

Method Detail

addCrlPathback to summary
public SSLOptions addCrlPath(String crlPath) throws NullPointerException

Add a CRL path

Parameters
crlPath:String

the path

Returns:SSLOptions

a reference to this, so the API can be used fluently

addCrlValueback to summary
public SSLOptions addCrlValue(Buffer crlValue) throws NullPointerException

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Add a CRL value

Parameters
crlValue:Buffer

the value

Returns:SSLOptions

a reference to this, so the API can be used fluently

addEnabledCipherSuiteback to summary
public SSLOptions addEnabledCipherSuite(String suite)

Add an enabled cipher suite, appended to the ordered suites.

Parameters
suite:String

the suite

Returns:SSLOptions

a reference to this, so the API can be used fluently

See Also
getEnabledCipherSuites()
addEnabledSecureTransportProtocolback to summary
public SSLOptions addEnabledSecureTransportProtocol(String protocol)

Add an enabled SSL/TLS protocols, appended to the ordered protocols.

Parameters
protocol:String

the SSL/TLS protocol to enable

Returns:SSLOptions

a reference to this, so the API can be used fluently

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getCrlPathsback to summary
public List<String> getCrlPaths()
Returns:List<String>

the CRL (Certificate revocation list) paths

getCrlValuesback to summary
public List<Buffer> getCrlValues()

Get the CRL values

Returns:List<Buffer>

the list of values

getEnabledCipherSuitesback to summary
public Set<String> 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 SSLEngineOptions in use.

Returns:Set<String>

the enabled cipher suites

getEnabledSecureTransportProtocolsback to summary
public Set<String> getEnabledSecureTransportProtocols()

Returns the enabled SSL/TLS protocols

Returns:Set<String>

the enabled protocols

getKeyCertOptionsback to summary
public KeyCertOptions getKeyCertOptions()
Returns:KeyCertOptions

the key/cert options

Annotations
@GenIgnore
getSslHandshakeTimeoutback to summary
public long getSslHandshakeTimeout()
Returns:long

the SSL handshake timeout, in time unit specified by getSslHandshakeTimeoutUnit().

getSslHandshakeTimeoutUnitback to summary
public TimeUnit getSslHandshakeTimeoutUnit()
Returns:TimeUnit

the SSL handshake timeout unit.

getTrustOptionsback to summary
public TrustOptions getTrustOptions()
Returns:TrustOptions

the trust options

initback to summary
private void init()
isUseAlpnback to summary
public boolean isUseAlpn()
Returns:boolean

whether to use or not Application-Layer Protocol Negotiation

removeEnabledCipherSuiteback to summary
public SSLOptions removeEnabledCipherSuite(String suite)

Removes an enabled cipher suite from the ordered suites.

Parameters
suite:String

the suite

Returns:SSLOptions

a reference to this, so the API can be used fluently

removeEnabledSecureTransportProtocolback to summary
public SSLOptions removeEnabledSecureTransportProtocol(String protocol)

Removes an enabled SSL/TLS protocol from the ordered protocols.

Parameters
protocol:String

the SSL/TLS protocol to disable

Returns:SSLOptions

a reference to this, so the API can be used fluently

setEnabledSecureTransportProtocolsback to summary
public SSLOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)

Sets the list of enabled SSL/TLS protocols.

Parameters
enabledSecureTransportProtocols:Set<String>

the SSL/TLS protocols to enable

Returns:SSLOptions

a reference to this, so the API can be used fluently

setKeyCertOptionsback to summary
public SSLOptions setKeyCertOptions(KeyCertOptions options)

Set the key/cert options.

Parameters
options:KeyCertOptions

the key store options

Returns:SSLOptions

a reference to this, so the API can be used fluently

Annotations
@GenIgnore
setSslHandshakeTimeoutback to summary
public SSLOptions setSslHandshakeTimeout(long sslHandshakeTimeout)

Set the SSL handshake timeout, default time unit is seconds.

Parameters
sslHandshakeTimeout:long

the SSL handshake timeout to set, in milliseconds

Returns:SSLOptions

a reference to this, so the API can be used fluently

setSslHandshakeTimeoutUnitback to summary
public SSLOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)

Set the SSL handshake timeout unit. If not specified, default is seconds.

Parameters
sslHandshakeTimeoutUnit:TimeUnit

specify time unit.

Returns:SSLOptions

a reference to this, so the API can be used fluently

setTrustOptionsback to summary
public SSLOptions setTrustOptions(TrustOptions options)

Set the trust options.

Parameters
options:TrustOptions

the trust options

Returns:SSLOptions

a reference to this, so the API can be used fluently

setUseAlpnback to summary
public SSLOptions setUseAlpn(boolean useAlpn)

Set the ALPN usage.

Parameters
useAlpn:boolean

true when Application-Layer Protocol Negotiation should be used

toJsonback to summary
public JsonObject toJson()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Convert to JSON

Returns:JsonObject

the JSON