Package org.conscrypt
Class OpenSSLSocketFactoryImpl
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- org.conscrypt.OpenSSLSocketFactoryImpl
-
public class OpenSSLSocketFactoryImpl extends SSLSocketFactory
-
-
Constructor Summary
Constructors Constructor Description OpenSSLSocketFactoryImpl()OpenSSLSocketFactoryImpl(SSLParametersImpl sslParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SocketcreateSocket()Creates a new socket which is not connected to any remote host.SocketcreateSocket(String hostname, int port)Creates a new socket which is connected to the remote host specified by the parametershostandport.SocketcreateSocket(String hostname, int port, InetAddress localHost, int localPort)Creates a new socket which is connected to the remote host specified by the parametershostandport.SocketcreateSocket(InetAddress address, int port)Creates a new socket which is connected to the remote host specified by the InetAddresshost.SocketcreateSocket(InetAddress address, int port, InetAddress localAddress, int localPort)Creates a new socket which is connected to the remote host specified by the InetAddressaddress.SocketcreateSocket(Socket s, String hostname, int port, boolean autoClose)Creates anSSLSocketover the specified socket that is connected to the specified host at the specified port.String[]getDefaultCipherSuites()Returns the names of the cipher suites that are enabled by default.String[]getSupportedCipherSuites()Returns the names of the cipher suites that are supported and could be enabled for an SSL connection.-
Methods inherited from class javax.net.ssl.SSLSocketFactory
getDefault
-
Methods inherited from class javax.net.SocketFactory
setDefault
-
-
-
-
Constructor Detail
-
OpenSSLSocketFactoryImpl
public OpenSSLSocketFactoryImpl()
-
OpenSSLSocketFactoryImpl
public OpenSSLSocketFactoryImpl(SSLParametersImpl sslParameters)
-
-
Method Detail
-
getDefaultCipherSuites
public String[] getDefaultCipherSuites()
Description copied from class:SSLSocketFactoryReturns the names of the cipher suites that are enabled by default.- Specified by:
getDefaultCipherSuitesin classSSLSocketFactory- Returns:
- the names of the cipher suites that are enabled by default.
-
getSupportedCipherSuites
public String[] getSupportedCipherSuites()
Description copied from class:SSLSocketFactoryReturns the names of the cipher suites that are supported and could be enabled for an SSL connection.- Specified by:
getSupportedCipherSuitesin classSSLSocketFactory- Returns:
- the names of the cipher suites that are supported.
-
createSocket
public Socket createSocket() throws IOException
Description copied from class:SocketFactoryCreates a new socket which is not connected to any remote host. This method has to be overridden by a subclass otherwise aSocketExceptionis thrown.- Overrides:
createSocketin classSocketFactory- Returns:
- the created unconnected socket.
- Throws:
IOException- if an error occurs while creating a new socket.
-
createSocket
public Socket createSocket(String hostname, int port) throws IOException, UnknownHostException
Description copied from class:SocketFactoryCreates a new socket which is connected to the remote host specified by the parametershostandport. The socket is bound to any available local address and port.- Specified by:
createSocketin classSocketFactory- Parameters:
hostname- the remote host address the socket has to be connected to.port- the port number of the remote host at which the socket is connected.- Returns:
- the created connected socket.
- Throws:
IOException- if an error occurs while creating a new socket.UnknownHostException- if the specified host is unknown or the IP address could not be resolved.
-
createSocket
public Socket createSocket(String hostname, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException
Description copied from class:SocketFactoryCreates a new socket which is connected to the remote host specified by the parametershostandport. The socket is bound to the local network interface specified by the InetAddresslocalHoston portlocalPort.- Specified by:
createSocketin classSocketFactory- Parameters:
hostname- the remote host address the socket has to be connected to.port- the port number of the remote host at which the socket is connected.localHost- the local host address the socket is bound to.localPort- the port number of the local host at which the socket is bound.- Returns:
- the created connected socket.
- Throws:
IOException- if an error occurs while creating a new socket.UnknownHostException- if the specified host is unknown or the IP address could not be resolved.
-
createSocket
public Socket createSocket(InetAddress address, int port) throws IOException
Description copied from class:SocketFactoryCreates a new socket which is connected to the remote host specified by the InetAddresshost. The socket is bound to any available local address and port.- Specified by:
createSocketin classSocketFactory- Parameters:
address- the host address the socket has to be connected to.port- the port number of the remote host at which the socket is connected.- Returns:
- the created connected socket.
- Throws:
IOException- if an error occurs while creating a new socket.
-
createSocket
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
Description copied from class:SocketFactoryCreates a new socket which is connected to the remote host specified by the InetAddressaddress. The socket is bound to the local network interface specified by the InetAddresslocalHoston portlocalPort.- Specified by:
createSocketin classSocketFactory- Parameters:
address- the remote host address the socket has to be connected to.port- the port number of the remote host at which the socket is connected.localAddress- the local host address the socket is bound to.localPort- the port number of the local host at which the socket is bound.- Returns:
- the created connected socket.
- Throws:
IOException- if an error occurs while creating a new socket.
-
createSocket
public Socket createSocket(Socket s, String hostname, int port, boolean autoClose) throws IOException
Description copied from class:SSLSocketFactoryCreates anSSLSocketover the specified socket that is connected to the specified host at the specified port.- Specified by:
createSocketin classSSLSocketFactory- Parameters:
s- the socket.hostname- the host.port- the port number.autoClose-trueif socketsshould be closed when the created socket is closed,falseif the socketsshould be left open.- Returns:
- the creates ssl socket.
- Throws:
IOException- if creating the socket fails.UnknownHostException- if the host is unknown.
-
-