Utility class, which helps to configure SSLEngine. Should be passed to client via configuration properties.
Example:
SslContextConfigurator sslContextConfigurator = new SslContextConfigurator();
sslContextConfigurator.setTrustStoreFile("...");
sslContextConfigurator.setTrustStorePassword("...");
sslContextConfigurator.setTrustStoreType("...");
sslContextConfigurator.setKeyStoreFile("...");
sslContextConfigurator.setKeyStorePassword("...");
sslContextConfigurator.setKeyStoreType("...");
SslEngineConfigurator sslEngineConfigurator = new SslEngineConfigurator(sslContextConfigurator, true, false,
false);
client.getProperties().put(ClientManager.SSL_ENGINE_CONFIGURATOR, sslEngineConfigurator);
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | clientMode
Client mode when handshaking. |
| protected String[] | enabledCipherSuites
The list of cipher suites. |
| protected String[] | enabledProtocols
The list of protocols. |
| private HostnameVerifier | hostnameVerifier
A custom hostname verifier. |
| private boolean | hostVerificationEnabled
|
| private boolean | isCipherConfigured
Has the enabled Cipher configured. |
| private boolean | isProtocolConfigured
Has the enabled protocol configured. |
| protected boolean | needClientAuth
Require client Authentication. |
| protected volatile SSLContext | |
| protected volatile SslContextConfigurator | |
| private final Object | |
| protected boolean | wantClientAuth
True when requesting authentication. |
| Access | Constructor and Description |
|---|---|
| public | SslEngineConfigurator(SSLContext sslContext)
Create SSL Engine configuration basing on passed |
| public | SslEngineConfigurator(final SSLContext sslContext, final boolean
will be configured to work in client mode. clientMode, final boolean client authentication is required. needClientAuth, final boolean client should authenticate. wantClientAuth)Create SSL Engine configuration based on passed |
| public | SslEngineConfigurator(SslContextConfigurator sslContextConfiguration)
Create SSL Engine configuration based on passed |
| public | SslEngineConfigurator(SslContextConfigurator sslContextConfiguration, boolean
will be configured to work in client mode. clientMode, boolean client authentication is required. needClientAuth, boolean client should authenticate. wantClientAuth)Create SSL Engine configuration basing on passed |
| public | SslEngineConfigurator(SslEngineConfigurator
original original)SslEngineConfigurator instance to be copied.Copy constructor. |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public SSLEngine | |
| private static String[] | Returns: Array of SSL cipher suites to be enabled, or null if none of the requested ciphers are supported.ssl engine. sslEngine, String[] requested ciphers. requestedCiphers)Determines the SSL cipher suites to be enabled. |
| private static String[] | Returns: String[] an array of supported protocols.ssl engine. sslEngine, String[] requested protocols. requestedProtocols)Return the list of allowed protocol. |
| public SslEngineConfigurator | |
| public SSLEngine | Returns: SSLEngine.server host, which will be used to verify authenticity of the server (the provided host name
will
compared to the host in the certificate provided by the server). serverHost)Create and configure |
| public String[] | |
| public String[] | |
| public HostnameVerifier | Returns: user provided hostname verifier instance.Get custom hostname verifier. |
| public SSLContext | Returns: created ssl context.Create |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if the hostname verification is enabled, false otherwise.Get the hostname verification state. |
| public boolean | |
| public boolean | |
| public boolean | |
| public SslEngineConfigurator | |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.Set |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.String array with cipher suites.Set enabled cipher suites. |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.String array with protocols.Set enabled protocols. |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.custom hostname verifier. hostnameVerifier)Set custom hostname verifier. |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.when hostVerificationEnabled)true, servers hostname will be verified using JDK default
HostnameVerifier. When false, hostname verification won't be
performed unless custom HostnameVerifier is set.Set hostname verification. |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.value to be set. needClientAuth)Set "need client auth" property. |
| public SslEngineConfigurator | |
| public SslEngineConfigurator | Returns: updatedSslEngineConfigurator.value to be set. wantClientAuth)Set "want client auth" property. |
| public String |
| clientMode | back to summary |
|---|---|
| protected boolean clientMode Client mode when handshaking. | |
| enabledCipherSuites | back to summary |
|---|---|
| protected String[] enabledCipherSuites The list of cipher suites. | |
| enabledProtocols | back to summary |
|---|---|
| protected String[] enabledProtocols The list of protocols. | |
| hostnameVerifier | back to summary |
|---|---|
| private HostnameVerifier hostnameVerifier A custom hostname verifier. | |
| hostVerificationEnabled | back to summary |
|---|---|
| private boolean hostVerificationEnabled
| |
| isCipherConfigured | back to summary |
|---|---|
| private boolean isCipherConfigured Has the enabled Cipher configured. | |
| isProtocolConfigured | back to summary |
|---|---|
| private boolean isProtocolConfigured Has the enabled protocol configured. | |
| needClientAuth | back to summary |
|---|---|
| protected boolean needClientAuth Require client Authentication. | |
| sslContext | back to summary |
|---|---|
| protected volatile SSLContext sslContext | |
| sslContextConfiguration | back to summary |
|---|---|
| protected volatile SslContextConfigurator sslContextConfiguration | |
| sync | back to summary |
|---|---|
| private final Object sync | |
| wantClientAuth | back to summary |
|---|---|
| protected boolean wantClientAuth True when requesting authentication. | |
| SslEngineConfigurator | back to summary |
|---|---|
| public SslEngineConfigurator(SSLContext sslContext) Create SSL Engine configuration basing on passed
| |
| SslEngineConfigurator | back to summary |
|---|---|
| public SslEngineConfigurator(final SSLContext sslContext, final boolean clientMode, final boolean needClientAuth, final boolean wantClientAuth) Create SSL Engine configuration based on passed
| |
| SslEngineConfigurator | back to summary |
|---|---|
| public SslEngineConfigurator(SslContextConfigurator sslContextConfiguration) Create SSL Engine configuration based on passed
| |
| SslEngineConfigurator | back to summary |
|---|---|
| public SslEngineConfigurator(SslContextConfigurator sslContextConfiguration, boolean clientMode, boolean needClientAuth, boolean wantClientAuth) Create SSL Engine configuration basing on passed
| |
| SslEngineConfigurator | back to summary |
|---|---|
| public SslEngineConfigurator(SslEngineConfigurator original) Copy constructor.
| |
| SslEngineConfigurator | back to summary |
|---|---|
| protected SslEngineConfigurator() Default constructor. | |
| configure | back to summary |
|---|---|
| public SSLEngine configure(final SSLEngine sslEngine) Configure passed | |
| configureEnabledCiphers | back to summary |
|---|---|
| private static String[] configureEnabledCiphers(SSLEngine sslEngine, String[] requestedCiphers) Determines the SSL cipher suites to be enabled. | |
| configureEnabledProtocols | back to summary |
|---|---|
| private static String[] configureEnabledProtocols(SSLEngine sslEngine, String[] requestedProtocols) Return the list of allowed protocol. | |
| copy | back to summary |
|---|---|
| public SslEngineConfigurator copy() | |
| createSSLEngine | back to summary |
|---|---|
| public SSLEngine createSSLEngine(String serverHost) Create and configure | |
| getEnabledCipherSuites | back to summary |
|---|---|
| public String[] getEnabledCipherSuites() Get enabled cipher suites. | |
| getEnabledProtocols | back to summary |
|---|---|
| public String[] getEnabledProtocols() Get enabled protocols. | |
| getHostnameVerifier | back to summary |
|---|---|
| public HostnameVerifier getHostnameVerifier() Get custom hostname verifier.
| |
| getSslContext | back to summary |
|---|---|
| public SSLContext getSslContext() Create
| |
| isCipherConfigured | back to summary |
|---|---|
| public boolean isCipherConfigured() | |
| isClientMode | back to summary |
|---|---|
| public boolean isClientMode() Will
| |
| isHostVerificationEnabled | back to summary |
|---|---|
| public boolean isHostVerificationEnabled() Get the hostname verification state.
| |
| isNeedClientAuth | back to summary |
|---|---|
| public boolean isNeedClientAuth() Get "need client auth" property.
| |
| isProtocolConfigured | back to summary |
|---|---|
| public boolean isProtocolConfigured() | |
| isWantClientAuth | back to summary |
|---|---|
| public boolean isWantClientAuth() Get "want client auth" property.
| |
| setCipherConfigured | back to summary |
|---|---|
| public SslEngineConfigurator setCipherConfigured(boolean isCipherConfigured) | |
| setClientMode | back to summary |
|---|---|
| public SslEngineConfigurator setClientMode(boolean clientMode) Set
| |
| setEnabledCipherSuites | back to summary |
|---|---|
| public SslEngineConfigurator setEnabledCipherSuites(String[] enabledCipherSuites) Set enabled cipher suites.
| |
| setEnabledProtocols | back to summary |
|---|---|
| public SslEngineConfigurator setEnabledProtocols(String[] enabledProtocols) Set enabled protocols.
| |
| setHostnameVerifier | back to summary |
|---|---|
| public SslEngineConfigurator setHostnameVerifier(HostnameVerifier hostnameVerifier) Set custom hostname verifier.
When custom
| |
| setHostVerificationEnabled | back to summary |
|---|---|
| public SslEngineConfigurator setHostVerificationEnabled(boolean hostVerificationEnabled) Set hostname verification.
| |
| setNeedClientAuth | back to summary |
|---|---|
| public SslEngineConfigurator setNeedClientAuth(boolean needClientAuth) Set "need client auth" property.
| |
| setProtocolConfigured | back to summary |
|---|---|
| public SslEngineConfigurator setProtocolConfigured(boolean isProtocolConfigured) | |
| setWantClientAuth | back to summary |
|---|---|
| public SslEngineConfigurator setWantClientAuth(boolean wantClientAuth) Set "want client auth" property.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |