Top Description Fields Constructors Methods
org.conscrypt

pack-priv final Class OpenSSLSocketFactoryImpl

extends SSLSocketFactory
Class Inheritance
Static Imports
org.conscrypt.Platform.createEngineSocket, .Platform.createFileDescriptorSocket

An implementation of SSLSocketFactory based on BoringSSL.

This name of this class cannot change in order to maintain backward-compatibility with GMS core ProviderInstallerImpl

Field Summary

Modifier and TypeField and Description
private final IOException
private final SSLParametersImpl
private boolean
private static boolean

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Socket
createSocket()

Overrides javax.net.SocketFactory.createSocket.

Creates an unconnected socket.
public Socket
createSocket(String
the server host name with which to connect, or null for the loopback address.
hostname
,
int
the server port
port
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host at the specified remote port.
public Socket
createSocket(String
the server host name with which to connect, or null for the loopback address.
hostname
,
int
the server port
port
,
InetAddress
the local address the socket is bound to
localHost
,
int
the local port the socket is bound to
localPort
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host on the specified remote port.
public Socket
createSocket(InetAddress
the server host
address
,
int
the server port
port
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified port number at the specified address.
public Socket
createSocket(InetAddress
the server network address
address
,
int
the server port
port
,
InetAddress
the client network address
localAddress
,
int
the client port
localPort
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connect it to the specified remote address on the specified remote port.
public Socket
createSocket(Socket
the existing socket
socket
,
String
the server host
hostname
,
int
the server port
port
,
boolean
close the underlying socket when this socket is closed
autoClose
)

Implements abstract javax.net.ssl.SSLSocketFactory.createSocket.

Returns a socket layered over an existing socket connected to the named host, at the given port.
public String[]
getDefaultCipherSuites()

Implements abstract javax.net.ssl.SSLSocketFactory.getDefaultCipherSuites.

Returns the list of cipher suites which are enabled by default.
public String[]
getSupportedCipherSuites()

Implements abstract javax.net.ssl.SSLSocketFactory.getSupportedCipherSuites.

Returns the names of the cipher suites which could be enabled for use on an SSL connection.
private boolean
pack-priv void
setUseEngineSocket(boolean useEngineSocket)

Configures the socket to be created for this instance.

pack-priv static void
setUseEngineSocketByDefault(boolean useEngineSocket)

Configures the default socket type to be created for the default and all new instances.

Inherited from javax.net.ssl.SSLSocketFactory:
createSocketgetDefault

Field Detail

instantiationExceptionback to summary
private final IOException instantiationException
sslParametersback to summary
private final SSLParametersImpl sslParameters
useEngineSocketback to summary
private boolean useEngineSocket
useEngineSocketByDefaultback to summary
private static boolean useEngineSocketByDefault

Constructor Detail

OpenSSLSocketFactoryImplback to summary
pack-priv OpenSSLSocketFactoryImpl()
OpenSSLSocketFactoryImplback to summary
pack-priv OpenSSLSocketFactoryImpl(SSLParametersImpl sslParameters)

Method Detail

createSocketback to summary
public Socket createSocket() throws IOException

Overrides javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates an unconnected socket.

Returns:Socket

the unconnected socket

Annotations
@Override
Exceptions
IOException:
if the socket cannot be created
createSocketback to summary
public Socket createSocket(String hostname, int port) throws IOException, UnknownHostException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
hostname:String

the server host name with which to connect, or null for the loopback address.

port:int

the server port

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
UnknownHostException:
if the host is not known
createSocketback to summary
public Socket createSocket(String hostname, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
hostname:String

the server host name with which to connect, or null for the loopback address.

port:int

the server port

localHost:InetAddress

the local address the socket is bound to

localPort:int

the local port the socket is bound to

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
UnknownHostException:
if the host is not known
createSocketback to summary
public Socket createSocket(InetAddress address, int port) throws IOException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified port number at the specified address. This socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
address:InetAddress

the server host

port:int

the server port

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
createSocketback to summary
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connect it to the specified remote address on the specified remote port. The socket will also be bound to the local address and port supplied. The socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
address:InetAddress

the server network address

port:int

the server port

localAddress:InetAddress

the client network address

localPort:int

the client port

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
createSocketback to summary
public Socket createSocket(Socket socket, String hostname, int port, boolean autoClose) throws IOException

Implements abstract javax.net.ssl.SSLSocketFactory.createSocket.

Doc from javax.net.ssl.SSLSocketFactory.createSocket.

Returns a socket layered over an existing socket connected to the named host, at the given port. This constructor can be used when tunneling SSL through a proxy or when negotiating the use of SSL over an existing socket. The host and port refer to the logical peer destination. This socket is configured using the socket options established for this factory.

Parameters
socket:Socket

the existing socket

hostname:String

the server host

port:int

the server port

autoClose:boolean

close the underlying socket when this socket is closed

Returns:Socket

a socket connected to the specified host and port

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
getDefaultCipherSuitesback to summary
public String[] getDefaultCipherSuites()

Implements abstract javax.net.ssl.SSLSocketFactory.getDefaultCipherSuites.

Doc from javax.net.ssl.SSLSocketFactory.getDefaultCipherSuites.

Returns the list of cipher suites which are enabled by default. Unless a different list is enabled, handshaking on an SSL connection will use one of these cipher suites. The minimum quality of service for these defaults requires confidentiality protection and server authentication (that is, no anonymous cipher suites).

The returned array includes cipher suites from the list of standard cipher suite names in the JSSE Cipher Suite Names section of the Java Security Standard Algorithm Names Specification, and may also include other cipher suites that the provider supports.

Returns:String[]

array of the cipher suites enabled by default

Annotations
@Override
getSupportedCipherSuitesback to summary
public String[] getSupportedCipherSuites()

Implements abstract javax.net.ssl.SSLSocketFactory.getSupportedCipherSuites.

Doc from javax.net.ssl.SSLSocketFactory.getSupportedCipherSuites.

Returns the names of the cipher suites which could be enabled for use on an SSL connection. Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not meet quality of service requirements for those defaults. Such cipher suites are useful in specialized applications.

The returned array includes cipher suites from the list of standard cipher suite names in the JSSE Cipher Suite Names section of the Java Security Standard Algorithm Names Specification, and may also include other cipher suites that the provider supports.

Returns:String[]

an array of cipher suite names

Annotations
@Override
hasFileDescriptorback to summary
private boolean hasFileDescriptor(Socket s)
setUseEngineSocketback to summary
pack-priv void setUseEngineSocket(boolean useEngineSocket)

Configures the socket to be created for this instance. If not called, useEngineSocketByDefault will be used.

setUseEngineSocketByDefaultback to summary
pack-priv static void setUseEngineSocketByDefault(boolean useEngineSocket)

Configures the default socket type to be created for the default and all new instances.