Package org.xnio.ssl
Class JsseXnioSsl
java.lang.Object
org.xnio.ssl.XnioSsl
org.xnio.ssl.JsseXnioSsl
An XNIO SSL provider based on JSSE. Works with any XNIO provider.
- Author:
- David M. Lloyd, Flavia Rainone
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsseXnioSsl
(Xnio xnio, OptionMap optionMap) Construct a new instance.JsseXnioSsl
(Xnio xnio, OptionMap optionMap, SSLContext sslContext) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionconnectSsl
(XnioWorker worker, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super ConnectedSslStreamChannel> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap) Create an SSL connection to a remote host.createSslConnectionServer
(XnioWorker worker, InetSocketAddress bindAddress, ChannelListener<? super AcceptingChannel<SslConnection>> acceptListener, OptionMap optionMap) Create a bound TCP SSL server.createSslTcpServer
(XnioWorker worker, InetSocketAddress bindAddress, ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>> acceptListener, OptionMap optionMap) Create a bound TCP SSL server.Get the JSSE SSL context for this provider instance.static SSLEngine
getSslEngine
(SslConnection connection) Get the SSL engine for a given connection.openSslConnection
(XnioIoThread ioThread, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap) Create an SSL connection to a remote host.openSslConnection
(XnioWorker worker, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap) Create an SSL connection to a remote host.Methods inherited from class org.xnio.ssl.XnioSsl
connectSsl, connectSsl, connectSsl, openSslConnection, openSslConnection, openSslConnection, openSslConnection, openSslConnection, openSslConnection
-
Field Details
-
NEW_IMPL
public static final boolean NEW_IMPL
-
-
Constructor Details
-
JsseXnioSsl
public JsseXnioSsl(Xnio xnio, OptionMap optionMap) throws NoSuchProviderException, NoSuchAlgorithmException, KeyManagementException Construct a new instance.- Parameters:
xnio
- the XNIO instance to associate withoptionMap
- the options for this provider- Throws:
NoSuchProviderException
- if the given SSL provider is not foundNoSuchAlgorithmException
- if the given SSL algorithm is not supportedKeyManagementException
- if the SSL context could not be initialized
-
JsseXnioSsl
Construct a new instance.- Parameters:
xnio
- the XNIO instance to associate withoptionMap
- the options for this providersslContext
- the SSL context to use for this instance
-
-
Method Details
-
getSslContext
Get the JSSE SSL context for this provider instance.- Returns:
- the SSL context
-
getSslEngine
Get the SSL engine for a given connection.- Returns:
- the SSL engine
-
connectSsl
public IoFuture<ConnectedSslStreamChannel> connectSsl(XnioWorker worker, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super ConnectedSslStreamChannel> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap) Description copied from class:XnioSsl
Create an SSL connection to a remote host.- Specified by:
connectSsl
in classXnioSsl
- Parameters:
worker
- the worker to usebindAddress
- the local bind addressdestination
- the destination connection addressopenListener
- the initial open-connection listenerbindListener
- the bind listeneroptionMap
- the option map- Returns:
- the SSL connection
-
openSslConnection
public IoFuture<SslConnection> openSslConnection(XnioWorker worker, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap) Description copied from class:XnioSsl
Create an SSL connection to a remote host.- Specified by:
openSslConnection
in classXnioSsl
- Parameters:
worker
- the worker to usebindAddress
- the local bind addressdestination
- the destination connection addressopenListener
- the initial open-connection listenerbindListener
- the bind listeneroptionMap
- the option map- Returns:
- the SSL connection
-
openSslConnection
public IoFuture<SslConnection> openSslConnection(XnioIoThread ioThread, InetSocketAddress bindAddress, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap) Description copied from class:XnioSsl
Create an SSL connection to a remote host.- Specified by:
openSslConnection
in classXnioSsl
- Parameters:
ioThread
- the IO Thread to usebindAddress
- the local bind addressdestination
- the destination connection addressopenListener
- the initial open-connection listenerbindListener
- the bind listeneroptionMap
- the option map- Returns:
- the SSL connection
-
createSslTcpServer
public AcceptingChannel<ConnectedSslStreamChannel> createSslTcpServer(XnioWorker worker, InetSocketAddress bindAddress, ChannelListener<? super AcceptingChannel<ConnectedSslStreamChannel>> acceptListener, OptionMap optionMap) throws IOException Description copied from class:XnioSsl
Create a bound TCP SSL server.- Specified by:
createSslTcpServer
in classXnioSsl
- Parameters:
worker
- the worker to usebindAddress
- the address to bind toacceptListener
- the initial accept listeneroptionMap
- the initial configuration for the server- Returns:
- the unbound TCP SSL server
- Throws:
IOException
- if the server could not be created
-
createSslConnectionServer
public AcceptingChannel<SslConnection> createSslConnectionServer(XnioWorker worker, InetSocketAddress bindAddress, ChannelListener<? super AcceptingChannel<SslConnection>> acceptListener, OptionMap optionMap) throws IOException Description copied from class:XnioSsl
Create a bound TCP SSL server.- Specified by:
createSslConnectionServer
in classXnioSsl
- Parameters:
worker
- the worker to usebindAddress
- the address to bind toacceptListener
- the initial accept listeneroptionMap
- the initial configuration for the server- Returns:
- the unbound TCP SSL server
- Throws:
IOException
- if the server could not be created
-