Package edu.vt.middleware.ldap.ssl
Class ThreadLocalTLSSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
-
- edu.vt.middleware.ldap.ssl.TLSSocketFactory
-
- edu.vt.middleware.ldap.ssl.ThreadLocalTLSSocketFactory
-
public class ThreadLocalTLSSocketFactory extends TLSSocketFactory
TLSSocketFactory implementation that uses a thread local variable to store configuration. Useful for SSL configurations that can only retrieve the SSLSocketFactory from getDefault().- Version:
- $Revision: 2231 $ $Date: 2012-02-02 16:46:27 +0100 (Thu, 02 Feb 2012) $
- Author:
- Middleware Services
-
-
Field Summary
-
Fields inherited from class edu.vt.middleware.ldap.ssl.TLSSocketFactory
contextInitializer
-
Fields inherited from class edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
cipherSuites, DEFAULT_PROTOCOL, factory, hostnameVerifier, protocols
-
-
Constructor Summary
Constructors Constructor Description ThreadLocalTLSSocketFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.net.SocketFactory
getDefault()
This returns the default SSL socket factory.static javax.net.ssl.SSLSocketFactory
getHostnameVerifierFactory(java.lang.String[] names)
Returns an instance of this socket factory configured with a hostname verifying trust manager.SSLContextInitializer
getSSLContextInitializer()
Returns the SSL context initializer.void
setSSLContextInitializer(SSLContextInitializer initializer)
Sets the SSL context initializer.java.lang.String
toString()
Provides a descriptive string representation of this instance.-
Methods inherited from class edu.vt.middleware.ldap.ssl.TLSSocketFactory
initialize
-
Methods inherited from class edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
createSocket, createSocket, createSocket, createSocket, createSocket, createSocket, getDefaultCipherSuites, getEnabledCipherSuites, getEnabledProtocols, getFactory, getHostnameVerifier, getSupportedCipherSuites, initSSLSocket, setEnabledCipherSuites, setEnabledProtocols, setHostnameVerifier
-
-
-
-
Method Detail
-
getSSLContextInitializer
public SSLContextInitializer getSSLContextInitializer()
Returns the SSL context initializer.- Overrides:
getSSLContextInitializer
in classTLSSocketFactory
- Returns:
SSLContextInitializer
-
setSSLContextInitializer
public void setSSLContextInitializer(SSLContextInitializer initializer)
Sets the SSL context initializer.- Overrides:
setSSLContextInitializer
in classTLSSocketFactory
- Parameters:
initializer
- to create SSL contexts with
-
getDefault
public static javax.net.SocketFactory getDefault()
This returns the default SSL socket factory.- Returns:
- socket factory
-
getHostnameVerifierFactory
public static javax.net.ssl.SSLSocketFactory getHostnameVerifierFactory(java.lang.String[] names)
Returns an instance of this socket factory configured with a hostname verifying trust manager.- Parameters:
names
- to use for hostname verification- Returns:
- socket factory
-
toString
public java.lang.String toString()
Provides a descriptive string representation of this instance.- Overrides:
toString
in classTLSSocketFactory
- Returns:
- String of the form $Classname::factory=$factory.
-
-