Package org.glassfish.grizzly.config.ssl
Class JSSESocketFactory
java.lang.Object
org.glassfish.grizzly.config.ssl.ServerSocketFactory
org.glassfish.grizzly.config.ssl.JSSESocketFactory
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
JSSE14SocketFactory
SSL server socket factory. It _requires_ a valid RSA key and JSSE.
- Author:
- Harish Prabandham, Costin Manolache, Stefan Freyr Stefansson, EKR -- renamed to JSSESocketFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanstatic final Stringstatic final Stringprotected String[]protected booleanprotected static final Loggerprotected SSLServerSocketFactoryFields inherited from class org.glassfish.grizzly.config.ssl.ServerSocketFactory
attributes, context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptSocket(ServerSocket socket) Wrapper function for accept().createSocket(int port) Returns a server socket which uses all network interfaces on the host, and is bound to a the specified port.createSocket(int port, int backlog) Returns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog.createSocket(int port, int backlog, InetAddress ifAddress) Returns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog.protected String[]getEnabledCiphers(String requestedCiphers, String[] supportedCiphers) Determines the SSL cipher suites to be enabled.protected abstract String[]getEnabledProtocols(SSLServerSocket socket, String requestedProtocols) Determines the SSL protocol variants to be enabled.protected KeyStoregetKeystore(String pass) Gets the SSL server's keystore.protected StringGets the SSL server's keystore password.protected KeyStoreGets the SSL server's truststore.protected StringvoidExtra function to initiate the handshake.abstract voidinit()Reads the keystore and initializes the SSL socket factory.protected voidinitServerSocket(ServerSocket ssocket) Configures the given SSL server socket with the requested cipher suites, protocol versions, and need for client authenticationprotected abstract voidsetEnabledProtocols(SSLServerSocket socket, String[] protocols) Set the SSL protocol variants to be enabled.Methods inherited from class org.glassfish.grizzly.config.ssl.ServerSocketFactory
getDefault, getSSLContext, initSocket, setAttribute
-
Field Details
-
defaultProtocol
- See Also:
-
defaultAlgorithm
-
logger
-
initialized
protected boolean initialized -
clientAuthNeed
protected boolean clientAuthNeed -
clientAuthWant
protected boolean clientAuthWant -
sslProxy
-
enabledCiphers
-
-
Constructor Details
-
JSSESocketFactory
public JSSESocketFactory()
-
-
Method Details
-
createSocket
Description copied from class:ServerSocketFactoryReturns a server socket which uses all network interfaces on the host, and is bound to a the specified port. The socket is configured with the socket options (such as accept timeout) given to this factory.- Specified by:
createSocketin classServerSocketFactory- Parameters:
port- the port to listen to- Throws:
IOException- for networking errors
-
createSocket
Description copied from class:ServerSocketFactoryReturns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.- Specified by:
createSocketin classServerSocketFactory- Parameters:
port- the port to listen tobacklog- how many connections are queued- Throws:
IOException- for networking errors
-
createSocket
Description copied from class:ServerSocketFactoryReturns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.- Specified by:
createSocketin classServerSocketFactory- Parameters:
port- the port to listen tobacklog- how many connections are queuedifAddress- the network interface address to use- Throws:
IOException- for networking errors
-
acceptSocket
Description copied from class:ServerSocketFactoryWrapper function for accept(). This allows us to trap and translate exceptions if necessary- Specified by:
acceptSocketin classServerSocketFactory- Throws:
IOException
-
handshake
Description copied from class:ServerSocketFactoryExtra function to initiate the handshake. Sometimes necessary for SSL- Specified by:
handshakein classServerSocketFactory- Throws:
IOException
-
getEnabledCiphers
Determines the SSL cipher suites to be enabled.- Parameters:
requestedCiphers- Comma-separated list of requested cipherssupportedCiphers- Array of supported ciphers- Returns:
- Array of SSL cipher suites to be enabled, or null if none of the requested ciphers are supported
-
getKeystorePassword
Gets the SSL server's keystore password. -
getKeystore
Gets the SSL server's keystore.- Throws:
IOException
-
getTruststorePassword
-
getTrustStore
Gets the SSL server's truststore.- Throws:
IOException
-
init
Reads the keystore and initializes the SSL socket factory. Place holder method to initialize the KeyStore, etc.- Specified by:
initin classServerSocketFactory- Throws:
IOException
-
getEnabledProtocols
Determines the SSL protocol variants to be enabled.- Parameters:
socket- The socket to get supported list from.requestedProtocols- Comma-separated list of requested SSL protocol variants- Returns:
- Array of SSL protocol variants to be enabled, or null if none of the requested protocol variants are supported
-
setEnabledProtocols
Set the SSL protocol variants to be enabled.- Parameters:
socket- the SSLServerSocket.protocols- the protocols to use.
-
initServerSocket
Configures the given SSL server socket with the requested cipher suites, protocol versions, and need for client authentication
-