SSLParameters

Encapsulates parameters for an SSL/TLS connection. The parameters are the list of ciphersuites to be accepted in an SSL/TLS handshake, the list of protocols to be allowed, the endpoint identification algorithm during SSL/TLS handshaking, the Server Name Indication (SNI), the algorithm constraints and whether SSL/TLS servers should request or require client authentication, etc. <p> SSLParameters can be created via the constructors in this class. Objects can also be obtained using the <code>getSSLParameters()</code> methods in {@link SSLSocket#getSSLParameters SSLSocket} and {@link SSLServerSocket#getSSLParameters SSLServerSocket} and {@link SSLEngine#getSSLParameters SSLEngine} or the {@link SSLContext#getDefaultSSLParameters getDefaultSSLParameters()} and {@link SSLContext#getSupportedSSLParameters getSupportedSSLParameters()} methods in <code>SSLContext</code>. <p> SSLParameters can be applied to a connection via the methods {@link SSLSocket#setSSLParameters SSLSocket.setSSLParameters()} and {@link SSLServerSocket#setSSLParameters SSLServerSocket.setSSLParameters()} and {@link SSLEngine#setSSLParameters SSLEngine.setSSLParameters()}.

@see SSLSocket @see SSLEngine @see SSLContext

Constructors

this
this()

Constructs SSLParameters. <p> The values of cipherSuites, protocols, cryptographic algorithm constraints, endpoint identification algorithm, server names and server name matchers are set to <code>null</code>, useCipherSuitesOrder, wantClientAuth and needClientAuth are set to <code>false</code>.

this
this(string[] cipherSuites)

Constructs SSLParameters from the specified array of ciphersuites. <p> Calling this constructor is equivalent to calling the no-args constructor followed by <code>setCipherSuites(cipherSuites);</code>.

this
this(string[] cipherSuites, string[] protocols)

Constructs SSLParameters from the specified array of ciphersuites and protocols. <p> Calling this constructor is equivalent to calling the no-args constructor followed by <code>setCipherSuites(cipherSuites); setProtocols(protocols);</code>.

Members

Functions

getCipherSuites
string[] getCipherSuites()

Returns a copy of the array of ciphersuites or null if none have been set.

getEndpointIdentificationAlgorithm
string getEndpointIdentificationAlgorithm()

Gets the endpoint identification algorithm.

getNeedClientAuth
bool getNeedClientAuth()

Returns whether client authentication should be required.

getProtocols
string[] getProtocols()

Returns a copy of the array of protocols or null if none have been set.

getUseCipherSuitesOrder
bool getUseCipherSuitesOrder()

Returns whether the local cipher suites preference should be honored.

getWantClientAuth
bool getWantClientAuth()

Returns whether client authentication should be requested.

setCipherSuites
void setCipherSuites(string[] cipherSuites)

Sets the array of ciphersuites.

setEndpointIdentificationAlgorithm
void setEndpointIdentificationAlgorithm(string algorithm)

Sets the endpoint identification algorithm. <p> If the <code>algorithm</code> parameter is non-null or non-empty, the endpoint identification/verification procedures must be handled during SSL/TLS handshaking. This is to prevent man-in-the-middle attacks.

setNeedClientAuth
void setNeedClientAuth(bool needClientAuth)

Sets whether client authentication should be required. Calling this method clears the <code>wantClientAuth</code> flag.

setProtocols
void setProtocols(string[] protocols)

Sets the array of protocols.

setUseCipherSuitesOrder
void setUseCipherSuitesOrder(bool honorOrder)

Sets whether the local cipher suites preference should be honored.

setWantClientAuth
void setWantClientAuth(bool wantClientAuth)

Sets whether client authentication should be requested. Calling this method clears the <code>needClientAuth</code> flag.

Meta