Package edu.vt.middleware.ldap.ssl
Class SingletonTLSSocketFactory
- 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.SingletonTLSSocketFactory
-
public class SingletonTLSSocketFactory extends TLSSocketFactory
TLSSocketFactory implementation that uses a static SSLContextInitializer. Useful for SSL configurations that can only retrieve the SSLSocketFactory from getDefault().- Version:
- $Revision: 1742 $ $Date: 2010-11-19 16:18:06 +0100 (Fri, 19 Nov 2010) $
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected static SSLContextInitializerstaticContextInitializerSSLContextInitializer used for initializing SSL contexts.-
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 SingletonTLSSocketFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.net.SocketFactorygetDefault()This returns the default SSL socket factory.voidinitialize()Creates the underlying SSLContext using truststore and keystore attributes and makes this factory ready for use.voidsetSSLContextInitializer(SSLContextInitializer initializer)Sets the SSL context initializer.-
Methods inherited from class edu.vt.middleware.ldap.ssl.TLSSocketFactory
getSSLContextInitializer, toString
-
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
-
staticContextInitializer
protected static SSLContextInitializer staticContextInitializer
SSLContextInitializer used for initializing SSL contexts.
-
-
Method Detail
-
setSSLContextInitializer
public void setSSLContextInitializer(SSLContextInitializer initializer)
Sets the SSL context initializer.- Overrides:
setSSLContextInitializerin classTLSSocketFactory- Parameters:
initializer- to create SSL contexts with
-
initialize
public void initialize() throws java.security.GeneralSecurityExceptionCreates the underlying SSLContext using truststore and keystore attributes and makes this factory ready for use. Must be called before factory can be used.- Overrides:
initializein classTLSSocketFactory- 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
-
-