org.mortbay.jetty.security
Class SslSelectChannelConnector
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.AbstractBuffers
org.mortbay.jetty.AbstractConnector
org.mortbay.jetty.nio.AbstractNIOConnector
org.mortbay.jetty.nio.SelectChannelConnector
org.mortbay.jetty.security.SslSelectChannelConnector
- All Implemented Interfaces:
- LifeCycle, Buffers, Connector, NIOConnector
public class SslSelectChannelConnector
- extends SelectChannelConnector
SslSelectChannelConnector.
- Author:
- Nik Gonzalez , Greg Wilkins
Methods inherited from class org.mortbay.jetty.nio.SelectChannelConnector |
accept, close, doStop, getConnection, getDelaySelectKeyUpdate, getLocalPort, newContinuation, open, persist, setDelaySelectKeyUpdate, setMaxIdleTime, stopAccept |
Methods inherited from class org.mortbay.jetty.AbstractConnector |
configure, connectionClosed, connectionOpened, getAcceptors, getAcceptQueueSize, getConfidentialPort, getConfidentialScheme, getConnections, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpen, getConnectionsOpenMax, getConnectionsOpenMin, getConnectionsRequestsAve, getConnectionsRequestsMax, getConnectionsRequestsMin, getHost, getIntegralPort, getIntegralScheme, getLowResourceMaxIdleTime, getMaxIdleTime, getName, getPort, getRequests, getResolveNames, getServer, getSoLingerTime, getStatsOn, getStatsOnMs, getThreadPool, isConfidential, isIntegral, join, setAcceptors, setAcceptQueueSize, setConfidentialPort, setConfidentialScheme, setHost, setIntegralPort, setIntegralScheme, setLowResourceMaxIdleTime, setName, setPort, setResolveNames, setServer, setSoLingerTime, setStatsOn, setThreadPool, statsReset, toString |
DEFAULT_KEYSTORE
public static final String DEFAULT_KEYSTORE
- Default value for the keystore location path.
KEYPASSWORD_PROPERTY
public static final String KEYPASSWORD_PROPERTY
- String name of key password property.
- See Also:
- Constant Field Values
PASSWORD_PROPERTY
public static final String PASSWORD_PROPERTY
- String name of keystore password property.
- See Also:
- Constant Field Values
SslSelectChannelConnector
public SslSelectChannelConnector()
customize
public void customize(EndPoint endpoint,
Request request)
throws IOException
- Allow the Listener a chance to customise the request. before the server does its stuff.
This allows the required attributes to be set for SSL requests.
The requirements of the Servlet specs are:
- an attribute named "javax.servlet.request.cipher_suite" of type String.
- an attribute named "javax.servlet.request.key_size" of type Integer.
- an attribute named "javax.servlet.request.X509Certificate" of type
java.security.cert.X509Certificate[]. This is an array of objects of type X509Certificate,
the order of this array is defined as being in ascending order of trust. The first
certificate in the chain is the one set by the client, the next is the one used to
authenticate the first, and so on.
- Specified by:
customize
in interface Connector
- Overrides:
customize
in class SelectChannelConnector
- Parameters:
endpoint
- The Socket the request arrived on.
This should be a SocketEndPoint
wrapping a SSLSocket
.request
- HttpRequest to be customised.
- Throws:
IOException
getCipherSuites
public String[] getCipherSuites()
setCipherSuites
public void setCipherSuites(String[] cipherSuites)
setPassword
public void setPassword(String password)
setTrustPassword
public void setTrustPassword(String password)
setKeyPassword
public void setKeyPassword(String password)
getAlgorithm
public String getAlgorithm()
setAlgorithm
public void setAlgorithm(String algorithm)
getProtocol
public String getProtocol()
setProtocol
public void setProtocol(String protocol)
setKeystore
public void setKeystore(String keystore)
getKeystore
public String getKeystore()
getKeystoreType
public String getKeystoreType()
getNeedClientAuth
public boolean getNeedClientAuth()
setNeedClientAuth
public void setNeedClientAuth(boolean needClientAuth)
- Set the value of the needClientAuth property
- Parameters:
needClientAuth
- true iff we require client certificate authentication.
setKeystoreType
public void setKeystoreType(String keystoreType)
getProvider
public String getProvider()
getSecureRandomAlgorithm
public String getSecureRandomAlgorithm()
getSslKeyManagerFactoryAlgorithm
public String getSslKeyManagerFactoryAlgorithm()
getSslTrustManagerFactoryAlgorithm
public String getSslTrustManagerFactoryAlgorithm()
getTruststore
public String getTruststore()
getTruststoreType
public String getTruststoreType()
setProvider
public void setProvider(String _provider)
setSecureRandomAlgorithm
public void setSecureRandomAlgorithm(String algorithm)
setSslKeyManagerFactoryAlgorithm
public void setSslKeyManagerFactoryAlgorithm(String algorithm)
setSslTrustManagerFactoryAlgorithm
public void setSslTrustManagerFactoryAlgorithm(String algorithm)
setTruststore
public void setTruststore(String truststore)
setTruststoreType
public void setTruststoreType(String truststoreType)
newEndPoint
protected SelectChannelEndPoint newEndPoint(SocketChannel channel,
SelectorManager.SelectSet selectSet,
SelectionKey key)
throws IOException
- Overrides:
newEndPoint
in class SelectChannelConnector
- Throws:
IOException
createSSLEngine
protected SSLEngine createSSLEngine()
throws IOException
- Throws:
IOException
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class SelectChannelConnector
- Throws:
Exception
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2007 Mort Bay Consulting. All Rights Reserved.