Package org.keycloak.truststore
Class SSLSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- org.keycloak.truststore.SSLSocketFactory
-
- All Implemented Interfaces:
Comparator
public class SSLSocketFactory extends SSLSocketFactory implements Comparator
Using this class is ugly, but it is the only way to push our truststore to the default LDAP client implementation.This SSLSocketFactory can only use truststore configured by TruststoreProvider after the ProviderFactory was initialized using standard Spi load / init mechanism. That will only happen if "truststore" provider is configured by the Keycloak Provider SPI configuration mechanism
If TruststoreProvider is not available this SSLSocketFactory will delegate all operations to the SSLSocketFactory returned by
CryptoProvider.wrapFactoryForTruststore(javax.net.ssl.SSLSocketFactory)
, which will delegate further to the factory returned by javax.net.ssl.SSLSocketFactory.getDefault().- Author:
- Marko Strukelj
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Object socketFactory1, Object socketFactory2)
Socket
createSocket()
Socket
createSocket(String host, int port)
Socket
createSocket(String host, int port, InetAddress localHost, int localPort)
Socket
createSocket(InetAddress host, int port)
Socket
createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
Socket
createSocket(Socket socket, String host, int port, boolean autoClose)
static SSLSocketFactory
getDefault()
String[]
getDefaultCipherSuites()
String[]
getSupportedCipherSuites()
-
Methods inherited from class javax.net.ssl.SSLSocketFactory
createSocket
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
getDefault
public static SSLSocketFactory getDefault()
-
getDefaultCipherSuites
public String[] getDefaultCipherSuites()
- Specified by:
getDefaultCipherSuites
in classSSLSocketFactory
-
getSupportedCipherSuites
public String[] getSupportedCipherSuites()
- Specified by:
getSupportedCipherSuites
in classSSLSocketFactory
-
createSocket
public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException
- Specified by:
createSocket
in classSSLSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port) throws IOException
- Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException
- Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress host, int port) throws IOException
- Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
- Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket() throws IOException
- Overrides:
createSocket
in classSocketFactory
- Throws:
IOException
-
compare
public int compare(Object socketFactory1, Object socketFactory2)
- Specified by:
compare
in interfaceComparator
-
-