webcore.webserver
Class WebServerSSLSocketFactory

java.lang.Object
  |
  +--webcore.webserver.WebServerSSLSocketFactory
All Implemented Interfaces:
WebServerSocketFactoryInterface

public class WebServerSSLSocketFactory
extends java.lang.Object
implements WebServerSocketFactoryInterface

WebServer Socket Factory for SSL web servers


Field Summary
static java.lang.String[] CIPHER_SUITES_EXPORT
           
static java.lang.String KEY_MANAGER_FACTORY_TYPE
           
static java.lang.String KEY_STORE_TYPE
           
static boolean NEED_CLIENT_AUTHENTICATION
           
static java.lang.String SSL_VERSION
           
static java.lang.String TRUST_MANAGER_FACTORY_TYPE
           
 
Constructor Summary
WebServerSSLSocketFactory(java.lang.String ksPath, java.lang.String pass)
          constructs a new SSL Socket Factory
 
Method Summary
 java.net.ServerSocket getServerSocket(int requestedPort)
          Returns an SSL socket listening on the requested port.
 javax.net.ssl.SSLContext getSSLContext()
          Get the SSLContext.
 void setSSLContext(java.lang.String ksPath, java.lang.String pass)
          Setting the SSLContext will make this an HTTPS server.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEED_CLIENT_AUTHENTICATION

public static final boolean NEED_CLIENT_AUTHENTICATION
See Also:
Constant Field Values

KEY_STORE_TYPE

public static final java.lang.String KEY_STORE_TYPE
See Also:
Constant Field Values

KEY_MANAGER_FACTORY_TYPE

public static final java.lang.String KEY_MANAGER_FACTORY_TYPE
See Also:
Constant Field Values

TRUST_MANAGER_FACTORY_TYPE

public static final java.lang.String TRUST_MANAGER_FACTORY_TYPE
See Also:
Constant Field Values

SSL_VERSION

public static final java.lang.String SSL_VERSION
See Also:
Constant Field Values

CIPHER_SUITES_EXPORT

public static final java.lang.String[] CIPHER_SUITES_EXPORT
Constructor Detail

WebServerSSLSocketFactory

public WebServerSSLSocketFactory(java.lang.String ksPath,
                                 java.lang.String pass)
                          throws java.security.GeneralSecurityException,
                                 java.io.IOException
constructs a new SSL Socket Factory

Parameters:
ksPath - path to a java keystore containing the server's certificate and private key; the keystore password and key password must be the same
pass - the keystore password and key password
Throws:
java.lang.Exception - - this method throws a bunch of exceptions most of which indicate a configuration error
java.security.GeneralSecurityException
java.io.IOException
Method Detail

setSSLContext

public void setSSLContext(java.lang.String ksPath,
                          java.lang.String pass)
                   throws java.security.GeneralSecurityException,
                          java.io.IOException
Setting the SSLContext will make this an HTTPS server. Set the port to 443 if you want to use the default HTTPS port.

Parameters:
ksPath - path to a java keystore containing the server's certificate and private key; the keystore password and key password must be the same
pass - the keystore password and key password
Throws:
java.lang.Exception - - this method throws a bunch of exceptions most of which indicate a configuration error
java.security.GeneralSecurityException
java.io.IOException

getSSLContext

public javax.net.ssl.SSLContext getSSLContext()
Get the SSLContext. This will return null if the context has not been set.


getServerSocket

public java.net.ServerSocket getServerSocket(int requestedPort)
                                      throws java.io.IOException
Returns an SSL socket listening on the requested port.

Specified by:
getServerSocket in interface WebServerSocketFactoryInterface
Parameters:
requestedPort - the port for the server socket to listen on
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object