public class JSSServerSocket
extends javax.net.ssl.SSLServerSocket
| Constructor and Description |
|---|
JSSServerSocket()
Start building a new JSSServerSocket.
|
| Modifier and Type | Method and Description |
|---|---|
JSSSocket |
accept() |
protected JSSSocket |
acceptSocket(java.net.Socket child)
Helper to upgrade a Socket into a JSSSocket.
|
void |
bind(java.net.SocketAddress endpoint) |
void |
bind(java.net.SocketAddress endpoint,
int backlog) |
void |
close() |
void |
consumeSocket(java.net.ServerSocket parent)
Consume a parent socket, utilizing it for all accept operations.
|
JSSServerSocketChannel |
getChannel()
Get the underlying ServerSocketChannel for this Socket.
|
java.lang.String[] |
getEnabledCipherSuites()
Get the set of enabled cipher suites for this SSLSocket.
|
java.lang.String[] |
getEnabledProtocols()
Get the set of enabled protocol versions for this SSLSocket.
|
boolean |
getEnableSessionCreation()
Get whether or not this SSLSocket enables creation of new sessions.
|
JSSEngine |
getEngine()
Get the underlying JSSEngine instance.
|
java.net.InetAddress |
getInetAddress() |
protected JSSServerSocketChannel |
getInternalChannel()
Get the internal ServerSocketChannel for this Socket.
|
int |
getLocalPort() |
java.net.SocketAddress |
getLocalSocketAddress() |
boolean |
getNeedClientAuth()
Get whether or not this SSLSocket needs client authentication.
|
<T> T |
getOption(java.net.SocketOption<T> name) |
int |
getReceiveBufferSize() |
boolean |
getReuseAddress() |
int |
getSoTimeout() |
protected javax.net.ssl.SSLContext |
getSSLContext()
Get the SSLContext if one exists or create a new instance.
|
JSSParameters |
getSSLParameters()
Get the configuration of this SSLSocket as a JSSParameters object.
|
java.lang.String[] |
getSupportedCipherSuites()
Get the set of supported cipher suites for this SSLSocket.
|
java.lang.String[] |
getSupportedProtocols()
Get the set of supported protocol versions for this SSLSocket.
|
boolean |
getUseClientMode()
Get whether or not this SSLSocket is handshaking as a client.
|
boolean |
getWantClientAuth()
Get whether or not this SSLSocket wants client authentication.
|
void |
initEngine()
Explicitly initialize the SSLEngine with no session resumption
information.
|
void |
initEngine(java.lang.String host,
int port)
Explicitly initialize the SSLEngine with information for session
resumption, including peer's hostname and port.
|
boolean |
isBound() |
boolean |
isClosed() |
void |
setCertFromAlias(java.lang.String alias)
Set the certificate this SSLSocket will utilize from an alias in the
NSS DB.
|
void |
setEnabledCipherSuites(java.lang.String[] suites)
Set the list of enabled cipher suites for this SSLSocket.
|
void |
setEnabledProtocols(java.lang.String[] protocols)
Set the list of enabled protocol versions for this SSLSocket.
|
void |
setEnableSessionCreation(boolean enabled)
Set whether or not this SSLSocket enables creation of new sessions.
|
void |
setHostname(java.lang.String name)
Set the hostname this client socket is connecting to, for HTTPS TLS
certificate validation purposes.
|
void |
setKeyManager(javax.net.ssl.X509KeyManager km)
Set the KeyManager this SSLSocket will utilize to select a key.
|
void |
setKeyManagers(javax.net.ssl.X509KeyManager[] xkms)
Set the key managers this SSLSocket will utilize to select a key.
|
void |
setKeyMaterials(PK11Cert our_cert,
PK11PrivKey our_key)
Set the certificate this SSLSocket will utilize from a certificate and
its matching private key.
|
void |
setNeedClientAuth(boolean need)
Set whether or not this SSLSocket needs client authentication.
|
<T> java.net.ServerSocket |
setOption(java.net.SocketOption<T> name,
T value) |
void |
setPerformancePreferences(int connectionTime,
int latency,
int bandwidth) |
void |
setReceiveBufferSize(int size) |
void |
setReuseAddress(boolean on) |
void |
setSoTimeout(int timeout) |
void |
setSSLContext(javax.net.ssl.SSLContext ctx)
Explicitly set the SSLContext utilized by this JSSSocket instance.
|
void |
setSSLParameters(javax.net.ssl.SSLParameters params)
Set the configuration of this SSLSocket from the given SSLParameters
instance.
|
void |
setTrustManager(JSSTrustManager tm)
Set the trust manager this SSLSocket will utilize to validate a peer's
certificate.
|
void |
setTrustManagers(javax.net.ssl.X509TrustManager[] xtms)
Set the trust managers this SSLSocket will utilize to validate a peer's
certificate.
|
void |
setUseClientMode(boolean client)
Set whether or not this SSLSocket is handshaking as a client.
|
void |
setWantClientAuth(boolean want)
Set whether or not this SSLSocket wants client authentication.
|
java.util.Set<java.net.SocketOption<?>> |
supportedOptions() |
java.lang.String |
toString() |
public JSSServerSocket()
throws java.io.IOException
java.io.IOExceptionpublic void consumeSocket(java.net.ServerSocket parent)
protected javax.net.ssl.SSLContext getSSLContext()
throws java.io.IOException
java.io.IOExceptionpublic void setSSLContext(javax.net.ssl.SSLContext ctx)
throws java.io.IOException
java.io.IOExceptionpublic void initEngine()
throws java.io.IOException
java.io.IOExceptionpublic void initEngine(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOExceptionpublic JSSEngine getEngine()
public JSSServerSocketChannel getChannel()
getChannel in class java.net.ServerSocketServerSocket.getChannel()protected JSSServerSocketChannel getInternalChannel()
protected JSSSocket acceptSocket(java.net.Socket child) throws java.io.IOException
java.io.IOExceptionpublic void setHostname(java.lang.String name)
JSSEngine.setHostname(String)public void setCertFromAlias(java.lang.String alias)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionJSSEngine.setCertFromAlias(String)public void setKeyMaterials(PK11Cert our_cert, PK11PrivKey our_key) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionJSSEngine.setKeyMaterials(PK11Cert, PK11PrivKey)public void setKeyManager(javax.net.ssl.X509KeyManager km)
JSSEngine.setKeyManager(X509KeyManager)public void setKeyManagers(javax.net.ssl.X509KeyManager[] xkms)
public void setTrustManager(JSSTrustManager tm)
public void setTrustManagers(javax.net.ssl.X509TrustManager[] xtms)
public java.lang.String[] getEnabledCipherSuites()
getEnabledCipherSuites in class javax.net.ssl.SSLServerSocketJSSEngine.getEnabledCipherSuites(),
SSLSocket.getEnabledCipherSuites()public java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites in class javax.net.ssl.SSLServerSocketJSSEngine.getSupportedCipherSuites(),
SSLSocket.getSupportedCipherSuites()public void setEnabledCipherSuites(java.lang.String[] suites)
setEnabledCipherSuites in class javax.net.ssl.SSLServerSocketJSSEngine.setEnabledCipherSuites(String[]),
SSLSocket.setEnabledCipherSuites(String[])public java.lang.String[] getEnabledProtocols()
getEnabledProtocols in class javax.net.ssl.SSLServerSocketJSSEngine.getEnabledProtocols(),
SSLSocket.getEnabledProtocols()public java.lang.String[] getSupportedProtocols()
getSupportedProtocols in class javax.net.ssl.SSLServerSocketJSSEngine.getSupportedProtocols(),
SSLSocket.getSupportedProtocols()public void setEnabledProtocols(java.lang.String[] protocols)
setEnabledProtocols in class javax.net.ssl.SSLServerSocketJSSEngine.setEnabledProtocols(String[]),
SSLSocket.setEnabledProtocols(String[])public boolean getEnableSessionCreation()
getEnableSessionCreation in class javax.net.ssl.SSLServerSocketJSSEngine.getEnableSessionCreation(),
SSLSocket.getEnableSessionCreation()public void setEnableSessionCreation(boolean enabled)
setEnableSessionCreation in class javax.net.ssl.SSLServerSocketJSSEngine.setEnableSessionCreation(boolean),
SSLSocket.setEnableSessionCreation(boolean)public boolean getUseClientMode()
getUseClientMode in class javax.net.ssl.SSLServerSocketJSSEngine.getUseClientMode(),
SSLSocket.getUseClientMode()public void setUseClientMode(boolean client)
setUseClientMode in class javax.net.ssl.SSLServerSocketJSSEngine.setUseClientMode(boolean),
SSLSocket.setUseClientMode(boolean)public boolean getWantClientAuth()
getWantClientAuth in class javax.net.ssl.SSLServerSocketJSSEngine.getWantClientAuth(),
SSLSocket.getWantClientAuth()public void setWantClientAuth(boolean want)
setWantClientAuth in class javax.net.ssl.SSLServerSocketJSSEngine.setWantClientAuth(boolean),
SSLSocket.setWantClientAuth(boolean)public boolean getNeedClientAuth()
getNeedClientAuth in class javax.net.ssl.SSLServerSocketJSSEngine.getNeedClientAuth(),
SSLSocket.getNeedClientAuth()public void setNeedClientAuth(boolean need)
setNeedClientAuth in class javax.net.ssl.SSLServerSocketJSSEngine.setNeedClientAuth(boolean),
SSLSocket.setNeedClientAuth(boolean)public JSSParameters getSSLParameters()
getSSLParameters in class javax.net.ssl.SSLServerSocketJSSEngine.getSSLParameters(),
SSLSocket.getSSLParameters()public void setSSLParameters(javax.net.ssl.SSLParameters params)
setSSLParameters in class javax.net.ssl.SSLServerSocketJSSEngine.setSSLParameters(SSLParameters),
SSLSocket.setSSLParameters(SSLParameters)public JSSSocket accept() throws java.io.IOException
accept in class java.net.ServerSocketjava.io.IOExceptionpublic void bind(java.net.SocketAddress endpoint)
throws java.io.IOException
bind in class java.net.ServerSocketjava.io.IOExceptionpublic void bind(java.net.SocketAddress endpoint,
int backlog)
throws java.io.IOException
bind in class java.net.ServerSocketjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.net.ServerSocketjava.io.IOExceptionpublic java.net.InetAddress getInetAddress()
getInetAddress in class java.net.ServerSocketpublic int getLocalPort()
getLocalPort in class java.net.ServerSocketpublic java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress in class java.net.ServerSocketpublic int getSoTimeout()
throws java.io.IOException
getSoTimeout in class java.net.ServerSocketjava.io.IOExceptionpublic void setSoTimeout(int timeout)
throws java.net.SocketException
setSoTimeout in class java.net.ServerSocketjava.net.SocketExceptionpublic boolean getReuseAddress()
throws java.net.SocketException
getReuseAddress in class java.net.ServerSocketjava.net.SocketExceptionpublic void setReuseAddress(boolean on)
throws java.net.SocketException
setReuseAddress in class java.net.ServerSocketjava.net.SocketExceptionpublic int getReceiveBufferSize()
throws java.net.SocketException
getReceiveBufferSize in class java.net.ServerSocketjava.net.SocketExceptionpublic void setReceiveBufferSize(int size)
throws java.net.SocketException
setReceiveBufferSize in class java.net.ServerSocketjava.net.SocketExceptionpublic void setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
setPerformancePreferences in class java.net.ServerSocketpublic boolean isBound()
isBound in class java.net.ServerSocketpublic boolean isClosed()
isClosed in class java.net.ServerSocketpublic java.lang.String toString()
toString in class java.net.ServerSocketpublic <T> java.net.ServerSocket setOption(java.net.SocketOption<T> name,
T value)
throws java.io.IOException
java.io.IOExceptionpublic <T> T getOption(java.net.SocketOption<T> name)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Set<java.net.SocketOption<?>> supportedOptions()