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 intcompare(Object socketFactory1, Object socketFactory2)SocketcreateSocket()SocketcreateSocket(String host, int port)SocketcreateSocket(String host, int port, InetAddress localHost, int localPort)SocketcreateSocket(InetAddress host, int port)SocketcreateSocket(InetAddress address, int port, InetAddress localAddress, int localPort)SocketcreateSocket(Socket socket, String host, int port, boolean autoClose)static SSLSocketFactorygetDefault()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:
getDefaultCipherSuitesin classSSLSocketFactory
-
getSupportedCipherSuites
public String[] getSupportedCipherSuites()
- Specified by:
getSupportedCipherSuitesin classSSLSocketFactory
-
createSocket
public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException
- Specified by:
createSocketin classSSLSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress host, int port) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket() throws IOException
- Overrides:
createSocketin classSocketFactory- Throws:
IOException
-
compare
public int compare(Object socketFactory1, Object socketFactory2)
- Specified by:
comparein interfaceComparator
-
-