Class JSSServerSocket

java.lang.Object
java.net.ServerSocket
javax.net.ssl.SSLServerSocket
org.mozilla.jss.ssl.javax.JSSServerSocket
All Implemented Interfaces:
Closeable, AutoCloseable

public class JSSServerSocket extends SSLServerSocket
SSL-enabled server socket following the javax.net.ssl.SSLServerSocket interface. Most users will want to use the JSSServerSocketFactory provided by the Java Provider interface instead of using this class directly. This SSLSocket implementation is a wrapped implementation. In particular, we need to consume an existing ServerSocket (via the consumeSocket(...) call) which we actually use for the accept() call. When called from a socket factory, this additional socket will be automatically created for the caller. All JSSServerSocket instances have a underlying ServerSocketChannel, of type JSSServerSocketChannel. Notably lacking from javax.net.ssl is a javax.net.ssl.SSLServerSocketChannel interface, so JSSSocketChannel includes no additional SSL-specific options. This purely exists to facilitate creating JSSSocket instances. In order to interoperate with JSSEngine, many of the adjacent methods have been included in this class as well. This results in any accepted sockets cloning its configuration. To construct a (useful) new instance, the following calls must be made: - new JSSServerSocket(); - consumeSocket(inst); - initSSLEngine(...); - setKeyManagers(...); - setTrustManagers(...); Optionally, setSSLContext(...) could be called to provide the SSLContext from which the SSLEngine should be constructed. This should be called prior to initSSLEngine(...) being called.