SSLSocketFactory can be used to validate the identity of the HTTPS server against a list of trusted certificates and to authenticate to the HTTPS server using a private key.
| Modifier and Type | Field and Description |
|---|---|
| private final HostnameVerifier | |
| private static final Logger | |
| private final SSLSocketFactory | |
| private final String[] | |
| private final String[] | |
| private final TlsSessionValidator | |
| private static final List | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | SSLConnectionSocketFactory(final SSLContext sslContext, final String[] supportedProtocols, final String[] supportedCipherSuites, final HostnameVerifier hostnameVerifier)
|
| public | SSLConnectionSocketFactory(final SSLSocketFactory socketFactory, final HostnameVerifier hostnameVerifier)
|
| public | SSLConnectionSocketFactory(final SSLSocketFactory socketFactory, final String[] supportedProtocols, final String[] supportedCipherSuites, final HostnameVerifier hostnameVerifier)
|
| Modifier and Type | Method and Description |
|---|---|
| public Socket | connectSocket(final TimeValue
connect timeout. connectTimeout, final Socket the socket to connect, as obtained from socket, final HttpHost createSocket(HttpContext).
null indicates that a new socket should be created and connected.target host as specified by the caller (end user). host, final InetSocketAddress the resolved remote address to connect to. remoteAddress, final InetSocketAddress the local address to bind the socket to, or localAddress, final HttpContext null for any.the actual HTTP context. context)Implements org. |
| public Socket | connectSocket(final Socket
the socket to connect, as obtained from socket, final HttpHost createSocket(HttpContext).
null indicates that a new socket should be created and connected.target host as specified by the caller (end user). host, final InetSocketAddress the resolved remote address to connect to. remoteAddress, final InetSocketAddress the local address to bind the socket to, or localAddress, final Timeout null for any.connect timeout. connectTimeout, final Object connect request attachment. attachment, final HttpContext the actual HTTP context. context)Overrides default org. |
| protected void | connectSocket(final Socket
the socket to connect. sock, final InetSocketAddress the resolved remote address to connect to. remoteAddress, final Timeout connect timeout. connectTimeout, final HttpContext the actual HTTP context. context)Connects the socket to the target host with the given resolved remote address using
|
| public Socket | createLayeredSocket(final Socket
the existing socket socket, final String the name of the target host. target, final int the port to connect to on the target host. port, final HttpContext the actual HTTP context. context)Implements org. |
| public Socket | createLayeredSocket(final Socket
the existing socket socket, final String the name of the target host. target, final int the port to connect to on the target host. port, final Object connect request attachment. attachment, final HttpContext the actual HTTP context. context)Overrides default org. |
| public Socket | createSocket(final HttpContext context)
Implements org. |
| public Socket | createSocket(final Proxy proxy, final HttpContext context)
Overrides default org. |
| private void | executeHandshake(final SSLSocket sslsock, final String target, final Object attachment, final HttpContext context)
|
| public static SSLConnectionSocketFactory | Returns: default SSL socket factoryObtains default SSL socket factory with an SSL context based on the standard JSSE
trust material ( |
| public static SSLConnectionSocketFactory | Returns: default system SSL socket factoryObtains default SSL socket factory with an SSL context based on system properties as described in Java™ Secure Socket Extension (JSSE) Reference Guide. |
| pack-priv static boolean | |
| protected void | |
| protected void | prepareSocket(final SSLSocket socket, final HttpContext context)
Performs any custom initialization for a newly created SSLSocket (before the SSL handshake happens). |
| private void | |
| protected void |
| hostnameVerifier | back to summary |
|---|---|
| private final HostnameVerifier hostnameVerifier | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| socketFactory | back to summary |
|---|---|
| private final SSLSocketFactory socketFactory | |
| supportedCipherSuites | back to summary |
|---|---|
| private final String[] supportedCipherSuites | |
| supportedProtocols | back to summary |
|---|---|
| private final String[] supportedProtocols | |
| tlsSessionValidator | back to summary |
|---|---|
| private final TlsSessionValidator tlsSessionValidator | |
| WEAK_CIPHER_SUITE_PATTERNS | back to summary |
|---|---|
| private static final List<Pattern> WEAK_CIPHER_SUITE_PATTERNS | |
| WEAK_CIPHERS | back to summary |
|---|---|
| private static final String WEAK_CIPHERS | |
| WEAK_KEY_EXCHANGES | back to summary |
|---|---|
| private static final String WEAK_KEY_EXCHANGES | |
| SSLConnectionSocketFactory | back to summary |
|---|---|
| public SSLConnectionSocketFactory(final SSLContext sslContext) | |
| SSLConnectionSocketFactory | back to summary |
|---|---|
public SSLConnectionSocketFactory(final SSLContext sslContext, final HostnameVerifier hostnameVerifier)
| |
| SSLConnectionSocketFactory | back to summary |
|---|---|
public SSLConnectionSocketFactory(final SSLContext sslContext, final String[] supportedProtocols, final String[] supportedCipherSuites, final HostnameVerifier hostnameVerifier)
| |
| SSLConnectionSocketFactory | back to summary |
|---|---|
public SSLConnectionSocketFactory(final SSLSocketFactory socketFactory, final HostnameVerifier hostnameVerifier)
| |
| SSLConnectionSocketFactory | back to summary |
|---|---|
public SSLConnectionSocketFactory(final SSLSocketFactory socketFactory, final String[] supportedProtocols, final String[] supportedCipherSuites, final HostnameVerifier hostnameVerifier)
| |
| connectSocket | back to summary |
|---|---|
| public Socket connectSocket(final TimeValue connectTimeout, final Socket socket, final HttpHost host, final InetSocketAddress remoteAddress, final InetSocketAddress localAddress, final HttpContext context) throws IOException Implements org. Doc from org. Connects the socket to the target host with the given resolved remote address.
| |
| connectSocket | back to summary |
|---|---|
| public Socket connectSocket(final Socket socket, final HttpHost host, final InetSocketAddress remoteAddress, final InetSocketAddress localAddress, final Timeout connectTimeout, final Object attachment, final HttpContext context) throws IOException Overrides default org. Doc from org. Connects the socket to the target host with the given resolved remote address.
| |
| connectSocket | back to summary |
|---|---|
| protected void connectSocket(final Socket sock, final InetSocketAddress remoteAddress, final Timeout connectTimeout, final HttpContext context) throws IOException Connects the socket to the target host with the given resolved remote address using
| |
| createLayeredSocket | back to summary |
|---|---|
| public Socket createLayeredSocket(final Socket socket, final String target, final int port, final HttpContext context) throws IOException Implements org. Doc from org. Returns a socket connected to the given host that is layered over an existing socket. Used primarily for creating secure sockets through proxies.
| |
| createLayeredSocket | back to summary |
|---|---|
| public Socket createLayeredSocket(final Socket socket, final String target, final int port, final Object attachment, final HttpContext context) throws IOException Overrides default org. Doc from org. Returns a socket connected to the given host that is layered over an existing socket. Used primarily for creating secure sockets through proxies.
| |
| createSocket | back to summary |
|---|---|
| public Socket createSocket(final HttpContext context) throws IOException Implements org. Doc from org. Creates new, unconnected socket. The socket should subsequently be passed to
| |
| createSocket | back to summary |
|---|---|
| public Socket createSocket(final Proxy proxy, final HttpContext context) throws IOException Overrides default org. Doc from org. Creates new, unconnected socket via a proxy (generally SOCKS is expected).
The socket should subsequently be passed to
| |
| executeHandshake | back to summary |
|---|---|
| private void executeHandshake(final SSLSocket sslsock, final String target, final Object attachment, final HttpContext context) throws IOException | |
| getSocketFactory | back to summary |
|---|---|
| public static SSLConnectionSocketFactory getSocketFactory() throws SSLInitializationException Obtains default SSL socket factory with an SSL context based on the standard JSSE
trust material (
| |
| getSystemSocketFactory | back to summary |
|---|---|
| public static SSLConnectionSocketFactory getSystemSocketFactory() throws SSLInitializationException Obtains default SSL socket factory with an SSL context based on system properties as described in Java™ Secure Socket Extension (JSSE) Reference Guide.
| |
| isWeakCipherSuite | back to summary |
|---|---|
| pack-priv static boolean isWeakCipherSuite(final String cipherSuite) | |
| prepareSocket | back to summary |
|---|---|
| protected void prepareSocket(final SSLSocket socket) throws IOException
Deprecated
| |
| prepareSocket | back to summary |
|---|---|
| protected void prepareSocket(final SSLSocket socket, final HttpContext context) throws IOException Performs any custom initialization for a newly created SSLSocket
(before the SSL handshake happens).
The default implementation is a no-op, but could be overridden to, e.g.,
call
| |
| verifyHostname | back to summary |
|---|---|
| private void verifyHostname(final SSLSocket sslsock, final String hostname) throws IOException | |
| verifySession | back to summary |
|---|---|
| protected void verifySession(final String hostname, final SSLSession sslSession) throws SSLException | |