Package edu.vt.middleware.ldap.ssl
Class TLSSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
-
- edu.vt.middleware.ldap.ssl.TLSSocketFactory
-
- Direct Known Subclasses:
DefaultHostnameVerifier.SSLSocketFactory
,SingletonTLSSocketFactory
,ThreadLocalTLSSocketFactory
public class TLSSocketFactory extends AbstractTLSSocketFactory
TLSSocketFactory
is an extension of SSLSocketFactory. Note thatinitialize()
must be called prior to using this socket factory. This means that this class cannot be passed to implementations that expect the socket factory to function immediately after construction.- Version:
- $Revision: 1106 $ $Date: 2010-01-29 23:34:13 -0500 (Fri, 29 Jan 2010) $
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected SSLContextInitializer
contextInitializer
SSLContextInitializer used for initializing SSL contexts.-
Fields inherited from class edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
cipherSuites, DEFAULT_PROTOCOL, factory, hostnameVerifier, protocols
-
-
Constructor Summary
Constructors Constructor Description TLSSocketFactory()
-
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.SSLContextInitializer
getSSLContextInitializer()
Returns the SSL context initializer.void
initialize()
Creates the underlying SSLContext using truststore and keystore attributes and makes this factory ready for use.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.AbstractTLSSocketFactory
createSocket, createSocket, createSocket, createSocket, createSocket, createSocket, getDefaultCipherSuites, getEnabledCipherSuites, getEnabledProtocols, getFactory, getHostnameVerifier, getSupportedCipherSuites, initSSLSocket, setEnabledCipherSuites, setEnabledProtocols, setHostnameVerifier
-
-
-
-
Field Detail
-
contextInitializer
protected SSLContextInitializer contextInitializer
SSLContextInitializer used for initializing SSL contexts.
-
-
Method Detail
-
getSSLContextInitializer
public SSLContextInitializer getSSLContextInitializer()
Returns the SSL context initializer.- Returns:
SSLContextInitializer
-
setSSLContextInitializer
public void setSSLContextInitializer(SSLContextInitializer initializer)
Sets the SSL context initializer.- Parameters:
initializer
- to create SSL contexts with
-
initialize
public void initialize() throws java.security.GeneralSecurityException
Creates the underlying SSLContext using truststore and keystore attributes and makes this factory ready for use. Must be called before factory can be used.- Specified by:
initialize
in classAbstractTLSSocketFactory
- Throws:
java.security.GeneralSecurityException
- if the SSLContext cannot be created
-
getDefault
public static javax.net.SocketFactory getDefault()
This returns the default SSL socket factory.- Returns:
SocketFactory
-
toString
public java.lang.String toString()
Provides a descriptive string representation of this instance.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String of the form $Classname::factory=$factory.
-
-