Methods Summary |
---|
public synchronized java.net.Socket | createSocket(java.lang.String host, int port)
final String target = host + ":" + port;
trace( "createSocket: " + target );
final AdminRMISSLClientSocketFactoryEnv env = getEnv();
if ( mFactory == null)
{
mFactory = createSocketFactory( env );
trace( "createSocket: created socket factory" );
}
//trace( "creating socket: " + target );
final SSLSocket sslSocket = (SSLSocket)mFactory.createSocket( host, port );
final HandshakeCompletedListener listener = env.getHandshakeCompletedListener( );
if ( listener != null )
{
trace( "createSocket: added HandshakeCompletedListener: " + listener );
sslSocket.addHandshakeCompletedListener( listener );
}
trace( "created socket: " + target );
return( sslSocket );
|
private final javax.net.ssl.SSLSocketFactory | createSocketFactory(AdminRMISSLClientSocketFactoryEnv env)
SSLSocketFactory factory = null;
try
{
final TrustManager[] trustManagers = env.getTrustManagers( );
final SSLContext sslContext = SSLContext.getInstance( "TLSv1" );
sslContext.init( null, trustManagers, null );
factory = sslContext.getSocketFactory();
}
catch (Exception e)
{
e.printStackTrace();
throw (IOException) new IOException().initCause(e);
}
return( factory );
|
private synchronized AdminRMISSLClientSocketFactoryEnv | getEnv()Note that the environment is useless if it gets downloaded, since it would never be
possible for a client to configure it! However, that is OK as default
behavior will be used.
return( AdminRMISSLClientSocketFactoryEnvImpl.getInstance() );
|
private static javax.net.ssl.TrustManager[] | getTrustAny()
final TrustManager[] trustManagers = new TrustManager[ 1 ];
trustManagers[ 0 ] = TrustAnyTrustManager.getInstance();
return( trustManagers );
|
private static char[] | toCharArray(java.lang.String s)
return( s == null ? null : s.toCharArray() );
|
private final void | trace(java.lang.Object o)
if ( getEnv().getTrace() )
{
final String name = this.getClass().getName();
Logger.getLogger( name ).info( toString() + ": " + o.toString() );
}
|