Top Description Fields Constructors Methods
org.glassfish.tyrus.container.jdk.client

public Class SslEngineConfigurator

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, javax.net.ssl.SSLContext, .SSLEngine

Deprecated

Please use org.glassfish.tyrus.client.SslEngineConfigurator.

SSLEngineConfigurator class from Grizzly project.

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);
Author
Alexey Stashok

Field Summary

Modifier and TypeField 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 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
sslContextConfiguration

References Deprecated SslContextConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.
private final Object
protected boolean
wantClientAuth

True when requesting authentication.

Constructor Summary

AccessConstructor and Description
public
SslEngineConfigurator(SSLContext sslContext)

Create SSL Engine configuration basing on passed SSLContext.

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 basing on passed SSLContext, using passed client mode, need/want client auth parameters.

public
SslEngineConfigurator(SslContextConfigurator sslContextConfiguration)
References Deprecated SslContextConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

Create SSL Engine configuration basing on passed SslContextConfigurator.

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
)
References Deprecated SslContextConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

Create SSL Engine configuration basing on passed SslContextConfigurator.

public
SslEngineConfigurator(SslEngineConfigurator pattern)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

protected
SslEngineConfigurator()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public SSLEngine

Returns:

configured SSLEngine.
configure
(final SSLEngine
SSLEngine to configure.
sslEngine
)

Configure passed SSLEngine, using current configurator settings

private static String[]

Returns:

Array of SSL cipher suites to be enabled, or null if none of the requested ciphers are supported.
configureEnabledCiphers
(SSLEngine sslEngine, String[] requestedCiphers)

Determines the SSL cipher suites to be enabled.

private static String[]

Returns:

String[] an array of supported protocols.
configureEnabledProtocols
(SSLEngine sslEngine, String[] requestedProtocols)

Return the list of allowed protocol.

public SslEngineConfigurator
copy()
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public SSLEngine

Returns:

SSLEngine.
createSSLEngine
()

Create and configure SSLEngine, basing on current settings.

public String[]
public String[]
public SSLContext
public boolean
public boolean

Returns:

true, if SSLEngine will be configured to work in client mode, or false for server mode.
isClientMode
()

Will SSLEngine be configured to work in client mode.

public boolean
public boolean
public boolean
public SslEngineConfigurator
setCipherConfigured(boolean isCipherConfigured)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public SslEngineConfigurator

Returns:

updated configurator instance.
setClientMode
(boolean
true, if SSLEngine will be configured to work in client mode, or false for server mode.
clientMode
)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

Set SSLEngine to be configured to work in client mode.

public SslEngineConfigurator
setEnabledCipherSuites(String[] enabledCipherSuites)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public SslEngineConfigurator
setEnabledProtocols(String[] enabledProtocols)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public SslEngineConfigurator
setNeedClientAuth(boolean needClientAuth)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public SslEngineConfigurator
setProtocolConfigured(boolean isProtocolConfigured)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public SslEngineConfigurator
setWantClientAuth(boolean wantClientAuth)
References Deprecated SslEngineConfigurator is deprecated or references (maybe indirectly) at least one deprecated element.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

clientModeback to summary
protected boolean clientMode

Client mode when handshaking.

enabledCipherSuitesback to summary
protected String[] enabledCipherSuites

The list of cipher suites.

enabledProtocolsback to summary
protected String[] enabledProtocols

The list of protocols.

isCipherConfiguredback to summary
private boolean isCipherConfigured

Has the enabled Cipher configured.

isProtocolConfiguredback to summary
private boolean isProtocolConfigured

Has the enabled protocol configured.

needClientAuthback to summary
protected boolean needClientAuth

Require client Authentication.

sslContextback to summary
protected volatile SSLContext sslContext
sslContextConfigurationback to summary
protected volatile SslContextConfigurator sslContextConfiguration

References Deprecated

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

See corresponding docs for further information.

syncback to summary
private final Object sync
wantClientAuthback to summary
protected boolean wantClientAuth

True when requesting authentication.

Constructor Detail

SslEngineConfiguratorback to summary
public SslEngineConfigurator(SSLContext sslContext)

Create SSL Engine configuration basing on passed SSLContext.

Parameters
sslContext:SSLContext

SSLContext.

SslEngineConfiguratorback to summary
public SslEngineConfigurator(final SSLContext sslContext, final boolean clientMode, final boolean needClientAuth, final boolean wantClientAuth)

Create SSL Engine configuration basing on passed SSLContext, using passed client mode, need/want client auth parameters.

Parameters
sslContext:SSLContext

SSLContext.

clientMode:boolean

will be configured to work in client mode.

needClientAuth:boolean

client authentication is required.

wantClientAuth:boolean

client should authenticate.

SslEngineConfiguratorback to summary
public SslEngineConfigurator(SslContextConfigurator sslContextConfiguration)

References Deprecated

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

See corresponding docs for further information.

Create SSL Engine configuration basing on passed SslContextConfigurator. This constructor makes possible to initialize SSLEngine and SSLContext in lazy fashion on first createSSLEngine() call.

Parameters
sslContextConfiguration:SslContextConfigurator

SslContextConfigurator.

SslEngineConfiguratorback to summary
public SslEngineConfigurator(SslContextConfigurator sslContextConfiguration, boolean clientMode, boolean needClientAuth, boolean wantClientAuth)

References Deprecated

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

See corresponding docs for further information.

Create SSL Engine configuration basing on passed SslContextConfigurator. This constructor makes possible to initialize SSLEngine and SSLContext in lazy fashion on first createSSLEngine() call.

Parameters
sslContextConfiguration:SslContextConfigurator

SslContextConfigurator.

clientMode:boolean

will be configured to work in client mode.

needClientAuth:boolean

client authentication is required.

wantClientAuth:boolean

client should authenticate.

SslEngineConfiguratorback to summary
public SslEngineConfigurator(SslEngineConfigurator pattern)

References Deprecated

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

See corresponding docs for further information.

SslEngineConfiguratorback to summary
protected SslEngineConfigurator()

Default constructor.

Method Detail

configureback to summary
public SSLEngine configure(final SSLEngine sslEngine)

Configure passed SSLEngine, using current configurator settings

Parameters
sslEngine:SSLEngine

SSLEngine to configure.

Returns:SSLEngine

configured SSLEngine.

configureEnabledCiphersback to summary
private static String[] configureEnabledCiphers(SSLEngine sslEngine, String[] requestedCiphers)

Determines the SSL cipher suites to be enabled.

Returns:String[]

Array of SSL cipher suites to be enabled, or null if none of the requested ciphers are supported.

configureEnabledProtocolsback to summary
private static String[] configureEnabledProtocols(SSLEngine sslEngine, String[] requestedProtocols)

Return the list of allowed protocol.

Returns:String[]

String[] an array of supported protocols.

copyback to summary
public SslEngineConfigurator copy()

References Deprecated

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

See corresponding docs for further information.

createSSLEngineback to summary
public SSLEngine createSSLEngine()

Create and configure SSLEngine, basing on current settings.

Returns:SSLEngine

SSLEngine.

getEnabledCipherSuitesback to summary
public String[] getEnabledCipherSuites()
getEnabledProtocolsback to summary
public String[] getEnabledProtocols()
getSslContextback to summary
public SSLContext getSslContext()
isCipherConfiguredback to summary
public boolean isCipherConfigured()
isClientModeback to summary
public boolean isClientMode()

Will SSLEngine be configured to work in client mode.

Returns:boolean

true, if SSLEngine will be configured to work in client mode, or false for server mode.

isNeedClientAuthback to summary
public boolean isNeedClientAuth()
isProtocolConfiguredback to summary
public boolean isProtocolConfigured()
isWantClientAuthback to summary
public boolean isWantClientAuth()
setCipherConfiguredback to summary
public SslEngineConfigurator setCipherConfigured(boolean isCipherConfigured)

References Deprecated

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

See corresponding docs for further information.

setClientModeback to summary
public SslEngineConfigurator setClientMode(boolean clientMode)

References Deprecated

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

See corresponding docs for further information.

Set SSLEngine to be configured to work in client mode.

Parameters
clientMode:boolean

true, if SSLEngine will be configured to work in client mode, or false for server mode.

Returns:SslEngineConfigurator

updated configurator instance.

setEnabledCipherSuitesback to summary
public SslEngineConfigurator setEnabledCipherSuites(String[] enabledCipherSuites)

References Deprecated

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

See corresponding docs for further information.

setEnabledProtocolsback to summary
public SslEngineConfigurator setEnabledProtocols(String[] enabledProtocols)

References Deprecated

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

See corresponding docs for further information.

setNeedClientAuthback to summary
public SslEngineConfigurator setNeedClientAuth(boolean needClientAuth)

References Deprecated

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

See corresponding docs for further information.

setProtocolConfiguredback to summary
public SslEngineConfigurator setProtocolConfigured(boolean isProtocolConfigured)

References Deprecated

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

See corresponding docs for further information.

setWantClientAuthback to summary
public SslEngineConfigurator setWantClientAuth(boolean wantClientAuth)

References Deprecated

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

See corresponding docs for further information.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override