public class SSLSocket extends TCPSocket
SSL Socket for connexions to servers, based on a TCPSocket.
To create a SSL socket, you can use the default constructor SSLSocket(IOService)
that uses the Java SSL implementation. You can also provide a custom public
certificate chain that will be used to identify (the) server(s) (and will
override the system certificate chain). For do that, you could call
SSLSocket(IOService, File) or SSLSocket(IOService, InputStream)
to accomplish it. But if your needs doesn't fit the previous constructors,
you have a constructor that accepts a SSLSocketConfigurator to
allow you to make custom configurations (SSLSocket(IOService, SSLSocketConfigurator)).
As the implementation of an SSL socket is always on top of a TCPSocket,
the behaviour is the same as the TCPSocket. One thing to note is that
the SSL protocol could decide to send packets grouped or split a big packet,
so take account on that.
| Constructor and Description |
|---|
SSLSocket(IOService service)
Creates a SSL socket using the Java implementation and the system's keychain
certificates.
|
SSLSocket(IOService service,
java.io.File certificate)
Creates a SSL socket using the Java implementation and the provided certificate
chain in
.pem format. |
SSLSocket(IOService service,
java.io.InputStream certificate)
Creates a SSL socket using the Java implementation and the provided certificate
chain in
.pem format. |
SSLSocket(IOService service,
SSLSocketConfigurator conf)
Creates a SSL socket using the custom options you set in the
SSLSocketConfigurator.configure(SslContextBuilder) method. |
bind, close, closeAsync, connect, connectAsync, onClose, readableBytes, receive, receiveAsync, shutdown, shutdownAsync, shutdownInput, shutdownInputAsync, shutdownOutput, shutdownOutputAsync, waitUntilCloseaddOnDataReceivedListener, bind, checkSocketCreated, connect, connect, connectAsync, connectAsync, createFuture, createFuture, fireReceivedData, isOpen, localEndpoint, receive, receiveAsync, receivedBytes, remoteEndpoint, send, send, send, sendAsync, sendAsync, sendAsync, sendBytes, setOptionpublic SSLSocket(IOService service)
Creates a SSL socket using the Java implementation and the system's keychain certificates.
In HTTPS, the host identification is not done. If you need this
security extra, you should use SSLSocket(IOService, SSLSocketConfigurator).
service - IOService to attach this socketpublic SSLSocket(IOService service, java.io.File certificate)
Creates a SSL socket using the Java implementation and the provided certificate
chain in .pem format.
In HTTPS, the host identification is not done. If you need this extra of security,
you should use SSLSocket(IOService, SSLSocketConfigurator) and use the
option SslContextBuilder.trustManager(File).
service - IOService to attach this socketcertificate - Certificate chain in .pem formatpublic SSLSocket(IOService service, java.io.InputStream certificate)
Creates a SSL socket using the Java implementation and the provided certificate
chain in .pem format.
In HTTPS, the host identification is not done. If you need this extra of security,
you should use SSLSocket(IOService, SSLSocketConfigurator) and use the
option SslContextBuilder.trustManager(InputStream).
service - IOService to attach this socketcertificate - Certificate chain in .pem formatpublic SSLSocket(IOService service, SSLSocketConfigurator conf)
Creates a SSL socket using the custom options you set in the
SSLSocketConfigurator.configure(SslContextBuilder) method.
All methods available can be found in
SslContextBuilder.
For enable host identification for HTTPS, you should override
SSLSocketConfigurator.changeParameters(SSLParameters) and set the option
SSLParameters.setEndpointIdentificationAlgorithm(String) to "HTTPS"
service - IOService to attach this socketconf - Custom configuration set in SSLSocketConfigurator