Package org.keycloak.truststore
Class SSLSocketFactory
java.lang.Object
javax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
org.keycloak.truststore.SSLSocketFactory
- All Implemented Interfaces:
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
Modifier and TypeMethodDescriptionint
createSocket
(String host, int port) createSocket
(String host, int port, InetAddress localHost, int localPort) createSocket
(InetAddress host, int port) createSocket
(InetAddress address, int port, InetAddress localAddress, int localPort) createSocket
(Socket socket, String host, int port, boolean autoClose) static SSLSocketFactory
String[]
String[]
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 Details
-
getDefault
-
getDefaultCipherSuites
- Specified by:
getDefaultCipherSuites
in classSSLSocketFactory
-
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
- 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
- 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
- Overrides:
createSocket
in classSocketFactory
- Throws:
IOException
-
compare
- Specified by:
compare
in interfaceComparator
-