org.mortbay.http
Class SslListener

java.lang.Object
  extended byorg.mortbay.util.ThreadPool
      extended byorg.mortbay.util.ThreadedServer
          extended byorg.mortbay.http.SocketListener
              extended byorg.mortbay.http.SslListener
All Implemented Interfaces:
HttpListener, LifeCycle, java.io.Serializable

public class SslListener
extends SocketListener

JSSE Socket Listener. This is heavily based on the work from Court Demas, which in turn is based on the work from Forge Research.

Version:
$Id: SslListener.java,v 1.4 2005/10/07 14:13:57 gregwilkins Exp $
Author:
Greg Wilkins (gregw@mortbay.com), Court Demas (court@kiwiconsulting.com), Forge Research Pty Ltd ACN 003 491 576, Jan Hlavatý
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.mortbay.util.ThreadPool
ThreadPool.PoolThread
 
Field Summary
static java.lang.String DEFAULT_KEYSTORE
          Default value for the keystore location path.
static java.lang.String KEYPASSWORD_PROPERTY
          String name of key password property.
static java.lang.String PASSWORD_PROPERTY
          String name of keystore password property.
 
Fields inherited from class org.mortbay.util.ThreadPool
__DAEMON, __PRIORITY
 
Fields inherited from interface org.mortbay.http.HttpListener
ATTRIBUTE
 
Constructor Summary
SslListener()
          Constructor.
SslListener(InetAddrPort p_address)
          Constructor.
 
Method Summary
 java.lang.String getAlgorithm()
           
 java.lang.String[] getCipherSuites()
           
 java.lang.String getKeystore()
           
 java.lang.String getKeystoreType()
           
 boolean getNeedClientAuth()
           
 java.lang.String getProtocol()
           
 boolean getWantClientAuth()
           
 boolean isConfidential(HttpConnection connection)
          By default, we're confidential, given we speak SSL.
 boolean isIntegral(HttpConnection connection)
          By default, we're integral, given we speak SSL.
 void setAlgorithm(java.lang.String algorithm)
           
 void setCipherSuites(java.lang.String[] cipherSuites)
           
 void setKeyPassword(java.lang.String password)
           
 void setKeystore(java.lang.String keystore)
           
 void setKeystoreType(java.lang.String keystoreType)
           
 void setNeedClientAuth(boolean needClientAuth)
          Set the value of the needClientAuth property
 void setPassword(java.lang.String password)
           
 void setProtocol(java.lang.String protocol)
           
 void setWantClientAuth(boolean wantClientAuth)
          Set the value of the needClientAuth property
 
Methods inherited from class org.mortbay.http.SocketListener
customizeRequest, getBufferReserve, getBufferSize, getConfidentialPort, getConfidentialScheme, getDefaultScheme, getHttpHandler, getHttpServer, getIdentifyListener, getIntegralPort, getIntegralScheme, getLowResourcePersistTimeMs, getLowResources, handleConnection, isLowOnResources, isOutOfResources, persistConnection, setBufferReserve, setBufferSize, setConfidentialPort, setConfidentialScheme, setDefaultScheme, setHttpHandler, setHttpServer, setIdentifyListener, setIntegralPort, setIntegralScheme, setLowResourcePersistTimeMs, setLowResources, start, stop
 
Methods inherited from class org.mortbay.util.ThreadedServer
getAcceptorThreads, getAcceptQueueSize, getHost, getInetAddress, getInetAddrPort, getLingerTimeSecs, getMaxReadTimeMs, getPort, getServerSocket, getTcpNoDelay, handle, open, setAcceptorThreads, setAcceptQueueSize, setHost, setInetAddress, setInetAddrPort, setLingerTimeSecs, setMaxReadTimeMs, setPort, setTcpNoDelay, toString
 
Methods inherited from class org.mortbay.util.ThreadPool
getIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, getThreadsPriority, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, setThreadsPriority, shrink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.http.HttpListener
getHost, getPort, setHost, setPort
 
Methods inherited from interface org.mortbay.util.LifeCycle
isStarted
 

Field Detail

DEFAULT_KEYSTORE

public static final java.lang.String DEFAULT_KEYSTORE
Default value for the keystore location path.


PASSWORD_PROPERTY

public static final java.lang.String PASSWORD_PROPERTY
String name of keystore password property.

See Also:
Constant Field Values

KEYPASSWORD_PROPERTY

public static final java.lang.String KEYPASSWORD_PROPERTY
String name of key password property.

See Also:
Constant Field Values
Constructor Detail

SslListener

public SslListener()
Constructor.


SslListener

public SslListener(InetAddrPort p_address)
Constructor.

Parameters:
p_address -
Method Detail

getCipherSuites

public java.lang.String[] getCipherSuites()

setCipherSuites

public void setCipherSuites(java.lang.String[] cipherSuites)

setPassword

public void setPassword(java.lang.String password)

setKeyPassword

public void setKeyPassword(java.lang.String password)

getAlgorithm

public java.lang.String getAlgorithm()

setAlgorithm

public void setAlgorithm(java.lang.String algorithm)

getProtocol

public java.lang.String getProtocol()

setProtocol

public void setProtocol(java.lang.String protocol)

setKeystore

public void setKeystore(java.lang.String keystore)

getKeystore

public java.lang.String getKeystore()

getKeystoreType

public java.lang.String getKeystoreType()

setKeystoreType

public void setKeystoreType(java.lang.String keystoreType)

setNeedClientAuth

public void setNeedClientAuth(boolean needClientAuth)
Set the value of the needClientAuth property

Parameters:
needClientAuth - true iff we require client certificate authentication.

getNeedClientAuth

public boolean getNeedClientAuth()

setWantClientAuth

public void setWantClientAuth(boolean wantClientAuth)
Set the value of the needClientAuth property

Parameters:
wantClientAuth - true iff we would like client certificate authentication.

getWantClientAuth

public boolean getWantClientAuth()

isIntegral

public boolean isIntegral(HttpConnection connection)
By default, we're integral, given we speak SSL. But, if we've been told about an integral port, and said port is not our port, then we're not. This allows separation of listeners providing INTEGRAL versus CONFIDENTIAL constraints, such as one SSL listener configured to require client certs providing CONFIDENTIAL, whereas another SSL listener not requiring client certs providing mere INTEGRAL constraints.

Specified by:
isIntegral in interface HttpListener
Overrides:
isIntegral in class SocketListener

isConfidential

public boolean isConfidential(HttpConnection connection)
By default, we're confidential, given we speak SSL. But, if we've been told about an confidential port, and said port is not our port, then we're not. This allows separation of listeners providing INTEGRAL versus CONFIDENTIAL constraints, such as one SSL listener configured to require client certs providing CONFIDENTIAL, whereas another SSL listener not requiring client certs providing mere INTEGRAL constraints.

Specified by:
isConfidential in interface HttpListener
Overrides:
isConfidential in class SocketListener


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.