Class ThreadLocalSSLSocketFactory
java.lang.Object
javax.net.SocketFactory
org.wildfly.security.auth.realm.ldap.ThreadLocalSSLSocketFactory
An
SocketFactory that allow passing SSLSocket into DirContext.
DirContext allows SocketFactory passing only in form of class name string, which prevent
to pass different SSL configuration into different DirContexts without standalone classes.
This socket factory bypass this using thread local variable with SocketFactory,
which should be used in directly following socket-creating DirContext operation.- Author:
- Jan Kalina
-
Method Summary
Modifier and TypeMethodDescriptioncreateSocket(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) static SocketFactorystatic voidset(SocketFactory socketFactory) static voidunset()
-
Method Details
-
getDefault
-
set
-
unset
public static void unset() -
createSocket
- Overrides:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
- 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
- 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
-