public abstract class JSSESocketFactory extends ServerSocketFactory
Modifier and Type | Field and Description |
---|---|
protected boolean |
clientAuthNeed |
protected boolean |
clientAuthWant |
static String |
defaultAlgorithm |
static String |
defaultProtocol |
protected String[] |
enabledCiphers |
protected boolean |
initialized |
protected static Logger |
logger |
protected SSLServerSocketFactory |
sslProxy |
attributes, context
Constructor and Description |
---|
JSSESocketFactory() |
Modifier and Type | Method and Description |
---|---|
Socket |
acceptSocket(ServerSocket socket)
Wrapper function for accept().
|
ServerSocket |
createSocket(int port)
Returns a server socket which uses all network interfaces on the host, and is bound to a the specified port.
|
ServerSocket |
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.
|
ServerSocket |
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 KeyStore |
getKeystore(String pass)
Gets the SSL server's keystore.
|
protected String |
getKeystorePassword()
Gets the SSL server's keystore password.
|
protected KeyStore |
getTrustStore()
Gets the SSL server's truststore.
|
protected String |
getTruststorePassword() |
void |
handshake(Socket sock)
Extra function to initiate the handshake.
|
abstract void |
init()
Reads the keystore and initializes the SSL socket factory.
|
protected void |
initServerSocket(ServerSocket ssocket)
Configures the given SSL server socket with the requested cipher suites, protocol versions, and need for client
authentication
|
protected abstract void |
setEnabledProtocols(SSLServerSocket socket,
String[] protocols)
Set the SSL protocol variants to be enabled.
|
getDefault, getSSLContext, initSocket, setAttribute
public static final String defaultProtocol
public static final String defaultAlgorithm
protected static final Logger logger
protected boolean initialized
protected boolean clientAuthNeed
protected boolean clientAuthWant
protected SSLServerSocketFactory sslProxy
protected String[] enabledCiphers
public ServerSocket createSocket(int port) throws IOException
ServerSocketFactory
createSocket
in class ServerSocketFactory
port
- the port to listen toIOException
- for networking errorspublic ServerSocket createSocket(int port, int backlog) throws IOException
ServerSocketFactory
createSocket
in class ServerSocketFactory
port
- the port to listen tobacklog
- how many connections are queuedIOException
- for networking errorspublic ServerSocket createSocket(int port, int backlog, InetAddress ifAddress) throws IOException
ServerSocketFactory
createSocket
in class ServerSocketFactory
port
- the port to listen tobacklog
- how many connections are queuedifAddress
- the network interface address to useIOException
- for networking errorspublic Socket acceptSocket(ServerSocket socket) throws IOException
ServerSocketFactory
acceptSocket
in class ServerSocketFactory
IOException
public void handshake(Socket sock) throws IOException
ServerSocketFactory
handshake
in class ServerSocketFactory
IOException
protected String[] getEnabledCiphers(String requestedCiphers, String[] supportedCiphers)
requestedCiphers
- Comma-separated list of requested cipherssupportedCiphers
- Array of supported ciphersprotected String getKeystorePassword()
protected KeyStore getKeystore(String pass) throws IOException
IOException
protected String getTruststorePassword()
protected KeyStore getTrustStore() throws IOException
IOException
public abstract void init() throws IOException
init
in class ServerSocketFactory
IOException
protected abstract String[] getEnabledProtocols(SSLServerSocket socket, String requestedProtocols)
socket
- The socket to get supported list from.requestedProtocols
- Comma-separated list of requested SSL protocol variantsprotected abstract void setEnabledProtocols(SSLServerSocket socket, String[] protocols)
socket
- the SSLServerSocket.protocols
- the protocols to use.protected void initServerSocket(ServerSocket ssocket)
Copyright © 2019. All rights reserved.