edu.vt.middleware.ldap.ssl
Class SingletonTLSSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by edu.vt.middleware.ldap.ssl.AbstractTLSSocketFactory
              extended by edu.vt.middleware.ldap.ssl.TLSSocketFactory
                  extended by 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 10:18:06 -0500 (Fri, 19 Nov 2010) $
Author:
Middleware Services

Field Summary
protected static SSLContextInitializer staticContextInitializer
          SSLContextInitializer 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, protocols
 
Constructor Summary
SingletonTLSSocketFactory()
           
 
Method Summary
static SocketFactory getDefault()
          This returns the default SSL socket factory.
 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.
 
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, getSupportedCipherSuites, initSSLSocket, setEnabledCipherSuites, setEnabledProtocols
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

staticContextInitializer

protected static SSLContextInitializer staticContextInitializer
SSLContextInitializer used for initializing SSL contexts.

Constructor Detail

SingletonTLSSocketFactory

public SingletonTLSSocketFactory()
Method Detail

setSSLContextInitializer

public void setSSLContextInitializer(SSLContextInitializer initializer)
Sets the SSL context initializer.

Overrides:
setSSLContextInitializer in class TLSSocketFactory
Parameters:
initializer - to create SSL contexts with

initialize

public void initialize()
                throws 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.

Overrides:
initialize in class TLSSocketFactory
Throws:
GeneralSecurityException - if the SSLContext cannot be created

getDefault

public static SocketFactory getDefault()
This returns the default SSL socket factory.

Returns:
SocketFactory


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.