Top Description Inners Fields Constructors Methods
org.conscrypt

pack-priv Class ConscryptEngineSocket

extends OpenSSLSocketImpl
implements AliasChooser
Class Inheritance
All Implemented Interfaces
org.conscrypt.SSLParametersImpl.AliasChooser
Known Direct Subclasses
org.conscrypt.Java8EngineSocket
Static Imports
javax.net.ssl.SSLEngineResult.Status.CLOSED, .SSLEngineResult.Status.OK, org.conscrypt.SSLUtils.EngineStates.STATE_CLOSED, .SSLUtils.EngineStates.STATE_HANDSHAKE_COMPLETED, .SSLUtils.EngineStates.STATE_HANDSHAKE_STARTED, .SSLUtils.EngineStates.STATE_NEW, .SSLUtils.EngineStates.STATE_READY, .SSLUtils.EngineStates.STATE_READY_HANDSHAKE_CUT_THROUGH

Implements crypto handling by delegating to ConscryptEngine.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
ConscryptEngineSocket.SSLInputStream

Unwrap bytes read from the underlying socket.

private class
ConscryptEngineSocket.SSLOutputStream

Wrap bytes written to the underlying socket.

Field Summary

Modifier and TypeField and Description
private BufferAllocator
private static final ByteBuffer
private final ConscryptEngine
private final Object
private ConscryptEngineSocket.SSLInputStream
private ConscryptEngineSocket.SSLOutputStream
private int
private final Object

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ConscryptEngineSocket(String hostname, int port, SSLParametersImpl sslParameters)

pack-priv
ConscryptEngineSocket(InetAddress address, int port, SSLParametersImpl sslParameters)

pack-priv
ConscryptEngineSocket(String hostname, int port, InetAddress clientAddress, int clientPort, SSLParametersImpl sslParameters)

pack-priv
ConscryptEngineSocket(InetAddress address, int port, InetAddress clientAddress, int clientPort, SSLParametersImpl sslParameters)

pack-priv
ConscryptEngineSocket(Socket socket, String hostname, int port, boolean autoClose, SSLParametersImpl sslParameters)

Method Summary

Modifier and TypeMethod and Description
public final String
public final String
public final void
private void
private void
pack-priv byte[]
exportKeyingMaterial(String
the label to use in calculating the exported value. This must be an ASCII-only string.
label
,
byte[]
the application-specific context value to use in calculating the exported value. This may be null to use no application context, which is treated differently than an empty byte array.
context
,
int
the number of bytes of keying material to return.
length
)

Implements abstract org.conscrypt.AbstractConscryptSocket.exportKeyingMaterial.

Exports a value derived from the TLS master secret as described in RFC 5705.
pack-priv final SSLSession
getActiveSession()

Implements abstract org.conscrypt.AbstractConscryptSocket.getActiveSession.

Called by notifyHandshakeCompletedListeners() to get the currently active session.
public final String
getApplicationProtocol()

Implements abstract org.conscrypt.AbstractConscryptSocket.getApplicationProtocol.

Returns the most recent application protocol value negotiated for this connection.
pack-priv final String[]
getApplicationProtocols()

Implements abstract org.conscrypt.AbstractConscryptSocket.getApplicationProtocols.

Returns the list of supported ALPN protocols.
public final byte[]
getChannelId()

Implements abstract org.conscrypt.OpenSSLSocketImpl.getChannelId.

Gets the TLS Channel ID for this server socket.
private static X509TrustManager
public final String[]
getEnabledCipherSuites()

Implements abstract javax.net.ssl.SSLSocket.getEnabledCipherSuites.

Returns the names of the SSL cipher suites which are currently enabled for use on this connection.
public final String[]
getEnabledProtocols()

Implements abstract javax.net.ssl.SSLSocket.getEnabledProtocols.

Returns the names of the protocol versions which are currently enabled for use on this connection.
public final boolean
getEnableSessionCreation()

Implements abstract javax.net.ssl.SSLSocket.getEnableSessionCreation.

Returns true if new SSL sessions may be established by this socket.
public final String
getHandshakeApplicationProtocol()

Implements abstract org.conscrypt.AbstractConscryptSocket.getHandshakeApplicationProtocol.

Returns the application protocol value negotiated on a SSL/TLS handshake currently in progress.
public final SSLSession
getHandshakeSession()

Implements abstract org.conscrypt.OpenSSLSocketImpl.getHandshakeSession.

Returns the SSLSession being constructed during a SSL/TLS handshake.
public final InputStream
getInputStream()

Overrides org.conscrypt.AbstractConscryptSocket.getInputStream.

Returns an input stream for this socket.
public final boolean
getNeedClientAuth()

Implements abstract javax.net.ssl.SSLSocket.getNeedClientAuth.

Returns true if the socket will require client authentication.
public final OutputStream
getOutputStream()

Overrides org.conscrypt.AbstractConscryptSocket.getOutputStream.

Returns an output stream for this socket.
public final SSLSession
getSession()

Implements abstract javax.net.ssl.SSLSocket.getSession.

Returns the SSL Session in use by this connection.
public final SSLParameters
getSSLParameters()

Overrides javax.net.ssl.SSLSocket.getSSLParameters.

Returns the SSLParameters in effect for this SSLSocket.
public final String[]
getSupportedCipherSuites()

Implements abstract javax.net.ssl.SSLSocket.getSupportedCipherSuites.

Returns the names of the cipher suites which could be enabled for use on this connection.
public final String[]
getSupportedProtocols()

Implements abstract javax.net.ssl.SSLSocket.getSupportedProtocols.

Returns the names of the protocols which could be enabled for use on an SSL connection.
pack-priv byte[]
getTlsUnique()

Implements abstract org.conscrypt.AbstractConscryptSocket.getTlsUnique.

Returns the tls-unique channel binding value for this connection, per RFC 5929.
private InputStream
private OutputStream
public final boolean
getUseClientMode()

Implements abstract javax.net.ssl.SSLSocket.getUseClientMode.

Returns true if the socket is set to use client mode when handshaking.
public final boolean
getWantClientAuth()

Implements abstract javax.net.ssl.SSLSocket.getWantClientAuth.

Returns true if the socket will request client authentication.
private static ConscryptEngine
newEngine(SSLParametersImpl sslParameters, final ConscryptEngineSocket socket)

private void
pack-priv final void
setApplicationProtocols(String[]
the list of ALPN protocols
protocols
)

Implements abstract org.conscrypt.AbstractConscryptSocket.setApplicationProtocols.

Sets the list of ALPN protocols.
public final void
setApplicationProtocolSelector(ApplicationProtocolSelector selector)

Implements abstract org.conscrypt.AbstractConscryptSocket.setApplicationProtocolSelector.

Sets an application-provided ALPN protocol selector.
pack-priv final void
pack-priv void
public final void
setChannelIdEnabled(boolean enabled)

Implements abstract org.conscrypt.OpenSSLSocketImpl.setChannelIdEnabled.

Enables/disables TLS Channel ID for this server socket.
public final void
setChannelIdPrivateKey(PrivateKey
private key (enables TLS Channel ID) or null for no key (disables TLS Channel ID). The private key must be an Elliptic Curve (EC) key based on the NIST P-256 curve (aka SECG secp256r1 or ANSI X9.62 prime256v1).
privateKey
)

Implements abstract org.conscrypt.OpenSSLSocketImpl.setChannelIdPrivateKey.

Sets the PrivateKey to be used for TLS Channel ID by this client socket.
public final void
setEnabledCipherSuites(String[]
Names of all the cipher suites to enable
suites
)

Implements abstract javax.net.ssl.SSLSocket.setEnabledCipherSuites.

Sets the cipher suites enabled for use on this connection.
public final void
setEnabledProtocols(String[]
Names of all the protocols to enable.
protocols
)

Implements abstract javax.net.ssl.SSLSocket.setEnabledProtocols.

Sets the protocol versions enabled for use on this connection.
public final void
setEnableSessionCreation(boolean
true indicates that sessions may be created; this is the default. false indicates that an existing session must be resumed
flag
)

Implements abstract javax.net.ssl.SSLSocket.setEnableSessionCreation.

Controls whether new SSL sessions may be established by this socket.
public void
setHandshakeTimeout(int handshakeTimeoutMilliseconds)

Overrides org.conscrypt.OpenSSLSocketImpl.setHandshakeTimeout.

Set the handshake timeout on this socket.
public final void
setHostname(String
the desired SNI hostname, or null to disable
hostname
)

Overrides org.conscrypt.OpenSSLSocketImpl.setHostname.

This method enables Server Name Indication.
public final void
setNeedClientAuth(boolean
set to true if client authentication is required, or false if no client authentication is desired.
need
)

Implements abstract javax.net.ssl.SSLSocket.setNeedClientAuth.

Configures the socket to require client authentication.
public final void
setSSLParameters(SSLParameters
the parameters
sslParameters
)

Overrides javax.net.ssl.SSLSocket.setSSLParameters.

Applies SSLParameters to this socket.
public final void
setUseClientMode(boolean
true if the socket should start its handshaking in "client" mode
mode
)

Implements abstract javax.net.ssl.SSLSocket.setUseClientMode.

Configures the socket to use client (or server) mode when handshaking.
public final void
setUseSessionTickets(boolean
True to enable session tickets
useSessionTickets
)

Implements abstract org.conscrypt.OpenSSLSocketImpl.setUseSessionTickets.

This method enables session ticket support.
public final void
setWantClientAuth(boolean
set to true if client authentication is requested, or false if no client authentication is desired.
want
)

Implements abstract javax.net.ssl.SSLSocket.setWantClientAuth.

Configures the socket to request client authentication.
public final void
startHandshake()

Implements abstract javax.net.ssl.SSLSocket.startHandshake.

Starts an SSL handshake on this connection.
private void
waitForHandshake()

Waits for the handshake to complete.

Inherited from org.conscrypt.OpenSSLSocketImpl:
getAlpnSelectedProtocolgetFileDescriptor$getHostnamegetHostnameOrIPgetNpnSelectedProtocolgetSoWriteTimeoutsetAlpnProtocolssetAlpnProtocolssetNpnProtocolssetSoWriteTimeout