Package org.conscrypt
Class ConscryptServerSocket
- java.lang.Object
-
- java.net.ServerSocket
-
- javax.net.ssl.SSLServerSocket
-
- org.conscrypt.ConscryptServerSocket
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
final class ConscryptServerSocket extends javax.net.ssl.SSLServerSocketBoringSSL-based implementation of server sockets.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanchannelIdEnabledprivate SSLParametersImplsslParametersprivate booleanuseEngineSocket
-
Constructor Summary
Constructors Constructor Description ConscryptServerSocket(int port, int backlog, java.net.InetAddress iAddress, SSLParametersImpl sslParameters)ConscryptServerSocket(int port, int backlog, SSLParametersImpl sslParameters)ConscryptServerSocket(int port, SSLParametersImpl sslParameters)ConscryptServerSocket(SSLParametersImpl sslParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.Socketaccept()java.lang.String[]getEnabledCipherSuites()java.lang.String[]getEnabledProtocols()The names of the protocols' versions that in use on this SSL connection.booleangetEnableSessionCreation()booleangetNeedClientAuth()java.lang.String[]getSupportedCipherSuites()java.lang.String[]getSupportedProtocols()The names of the protocols' versions that may be used on this SSL connection.booleangetUseClientMode()booleangetWantClientAuth()(package private) booleanisChannelIdEnabled()Checks whether the TLS Channel ID extension is enabled for this server socket.(package private) voidsetChannelIdEnabled(boolean enabled)Enables/disables the TLS Channel ID extension for this server socket.voidsetEnabledCipherSuites(java.lang.String[] suites)This method enables the cipher suites listed by getSupportedCipherSuites().voidsetEnabledProtocols(java.lang.String[] protocols)This method enables the protocols' versions listed by getSupportedProtocols().voidsetEnableSessionCreation(boolean flag)voidsetNeedClientAuth(boolean need)voidsetUseClientMode(boolean mode)(package private) ConscryptServerSocketsetUseEngineSocket(boolean useEngineSocket)Configures the socket to be created for this instance.voidsetWantClientAuth(boolean want)-
Methods inherited from class java.net.ServerSocket
bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getOption, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, supportedOptions, toString
-
-
-
-
Field Detail
-
sslParameters
private final SSLParametersImpl sslParameters
-
channelIdEnabled
private boolean channelIdEnabled
-
useEngineSocket
private boolean useEngineSocket
-
-
Constructor Detail
-
ConscryptServerSocket
ConscryptServerSocket(SSLParametersImpl sslParameters) throws java.io.IOException
- Throws:
java.io.IOException
-
ConscryptServerSocket
ConscryptServerSocket(int port, SSLParametersImpl sslParameters) throws java.io.IOException- Throws:
java.io.IOException
-
ConscryptServerSocket
ConscryptServerSocket(int port, int backlog, SSLParametersImpl sslParameters) throws java.io.IOException- Throws:
java.io.IOException
-
ConscryptServerSocket
ConscryptServerSocket(int port, int backlog, java.net.InetAddress iAddress, SSLParametersImpl sslParameters) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
setUseEngineSocket
ConscryptServerSocket setUseEngineSocket(boolean useEngineSocket)
Configures the socket to be created for this instance.
-
getEnableSessionCreation
public boolean getEnableSessionCreation()
- Specified by:
getEnableSessionCreationin classjavax.net.ssl.SSLServerSocket
-
setEnableSessionCreation
public void setEnableSessionCreation(boolean flag)
- Specified by:
setEnableSessionCreationin classjavax.net.ssl.SSLServerSocket
-
getSupportedProtocols
public java.lang.String[] getSupportedProtocols()
The names of the protocols' versions that may be used on this SSL connection.- Specified by:
getSupportedProtocolsin classjavax.net.ssl.SSLServerSocket- Returns:
- an array of protocols names
-
getEnabledProtocols
public java.lang.String[] getEnabledProtocols()
The names of the protocols' versions that in use on this SSL connection.- Specified by:
getEnabledProtocolsin classjavax.net.ssl.SSLServerSocket- Returns:
- an array of protocols names
-
setEnabledProtocols
public void setEnabledProtocols(java.lang.String[] protocols)
This method enables the protocols' versions listed by getSupportedProtocols().- Specified by:
setEnabledProtocolsin classjavax.net.ssl.SSLServerSocket- Parameters:
protocols- names of all the protocols to enable.- Throws:
java.lang.IllegalArgumentException- when one or more of the names in the array are not supported, or when the array is null.
-
getSupportedCipherSuites
public java.lang.String[] getSupportedCipherSuites()
- Specified by:
getSupportedCipherSuitesin classjavax.net.ssl.SSLServerSocket
-
getEnabledCipherSuites
public java.lang.String[] getEnabledCipherSuites()
- Specified by:
getEnabledCipherSuitesin classjavax.net.ssl.SSLServerSocket
-
setChannelIdEnabled
void setChannelIdEnabled(boolean enabled)
Enables/disables the TLS Channel ID extension for this server socket.
-
isChannelIdEnabled
boolean isChannelIdEnabled()
Checks whether the TLS Channel ID extension is enabled for this server socket.
-
setEnabledCipherSuites
public void setEnabledCipherSuites(java.lang.String[] suites)
This method enables the cipher suites listed by getSupportedCipherSuites().- Specified by:
setEnabledCipherSuitesin classjavax.net.ssl.SSLServerSocket- Parameters:
suites- the names of all the cipher suites to enable- Throws:
java.lang.IllegalArgumentException- when one or more of the ciphers in array suites are not supported, or when the array is null.
-
getWantClientAuth
public boolean getWantClientAuth()
- Specified by:
getWantClientAuthin classjavax.net.ssl.SSLServerSocket
-
setWantClientAuth
public void setWantClientAuth(boolean want)
- Specified by:
setWantClientAuthin classjavax.net.ssl.SSLServerSocket
-
getNeedClientAuth
public boolean getNeedClientAuth()
- Specified by:
getNeedClientAuthin classjavax.net.ssl.SSLServerSocket
-
setNeedClientAuth
public void setNeedClientAuth(boolean need)
- Specified by:
setNeedClientAuthin classjavax.net.ssl.SSLServerSocket
-
setUseClientMode
public void setUseClientMode(boolean mode)
- Specified by:
setUseClientModein classjavax.net.ssl.SSLServerSocket
-
getUseClientMode
public boolean getUseClientMode()
- Specified by:
getUseClientModein classjavax.net.ssl.SSLServerSocket
-
accept
public java.net.Socket accept() throws java.io.IOException- Overrides:
acceptin classjava.net.ServerSocket- Throws:
java.io.IOException
-
-