## 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 <ngonzalez@exist.com>, Greg Wilkins <gregw@mortbay.com>

Nested Class Summary

Nested classes/interfaces inherited from class org.mortbay.jetty.nio.SelectChannelConnector
`SelectChannelConnector.ConnectorEndPoint, SelectChannelConnector.RetryContinuation`

Field Summary
`static String` `DEFAULT_KEYSTORE` Default value for the keystore location path.
`static String` `KEYPASSWORD_PROPERTY` String name of key password property.
`static String` `PASSWORD_PROPERTY` String name of keystore password property.

Fields inherited from class org.mortbay.jetty.AbstractConnector
`_lowResourceMaxIdleTime, _maxIdleTime, _soLingerTime`

Fields inherited from class org.mortbay.jetty.AbstractBuffers
`_loss, BUFFER_LOSS_RATE`

Constructor Summary
`SslSelectChannelConnector()`

Method Summary
`protected SSLContext` `createSSLContext()`
`protected SSLEngine` `createSSLEngine()`
`void` `customize(EndPoint endpoint, Request request)` Allow the Listener a chance to customise the request.
`protected void` `doStart()`
`String` `getAlgorithm()`
`Buffer` `getBuffer(int size)`
`String[]` `getCipherSuites()` Deprecated. As of Java Servlet API 2.0, with no replacement.
`String[]` `getExcludeCipherSuites()`
`String` `getKeystore()`
`String` `getKeystoreType()`
`boolean` `getNeedClientAuth()`
`String` `getProtocol()`
`String` `getProvider()`
`String` `getSecureRandomAlgorithm()`
`String` `getSslKeyManagerFactoryAlgorithm()`
`String` `getSslTrustManagerFactoryAlgorithm()`
`String` `getTruststore()`
`String` `getTruststoreType()`
`boolean` `getWantClientAuth()`
`boolean` `isConfidential(Request request)` By default, we're confidential, given we speak SSL.
`boolean` `isIntegral(Request request)` By default, we're integral, given we speak SSL.
`protected Connection` `newConnection(SocketChannel channel, SelectChannelEndPoint endpoint)`
`protected SelectChannelEndPoint` `newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key)`
`void` `returnBuffer(Buffer buffer)`
`void` `setAlgorithm(String algorithm)`
`void` `setCipherSuites(String[] cipherSuites)` Deprecated. As of Java Servlet API 2.0, with no replacement.
`void` `setExcludeCipherSuites(String[] cipherSuites)`
`void` `setKeyPassword(String password)`
`void` `setKeystore(String keystore)`
`void` `setKeystoreType(String keystoreType)`
`void` `setNeedClientAuth(boolean needClientAuth)` Set the value of the needClientAuth property
`void` `setPassword(String password)`
`void` `setProtocol(String protocol)`
`void` `setProvider(String _provider)`
`void` `setSecureRandomAlgorithm(String algorithm)`
`void` `setSslKeyManagerFactoryAlgorithm(String algorithm)`
`void` `setSslTrustManagerFactoryAlgorithm(String algorithm)`
`void` `setTrustPassword(String password)`
`void` `setTruststore(String truststore)`
`void` `setTruststoreType(String truststoreType)`
`void` `setWantClientAuth(boolean wantClientAuth)`

Methods inherited from class org.mortbay.jetty.nio.SelectChannelConnector
`accept, close, doStop, getConnection, getDelaySelectKeyUpdate, getLocalPort, getLowResourcesConnections, getLowResourcesMaxIdleTime, newContinuation, open, persist, setDelaySelectKeyUpdate, setLowResourceMaxIdleTime, setLowResourcesConnections, setLowResourcesMaxIdleTime, setMaxIdleTime`

Methods inherited from class org.mortbay.jetty.nio.AbstractNIOConnector
`getUseDirectBuffers, newBuffer, setUseDirectBuffers`

Methods inherited from class org.mortbay.jetty.AbstractConnector

`configure, connectionClosed, connectionOpened, getAcceptorPriorityOffset, getAcceptors, getAcceptQueueSize, getConfidentialPort, getConfidentialScheme, getConnections, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpen, getConnectionsOpenMax, getConnectionsOpenMin, getConnectionsRequestsAve, getConnectionsRequestsMax, getConnectionsRequestsMin, getHost, getIntegralPort, getIntegralScheme, getLowResourceMaxIdleTime, getMaxIdleTime, getName, getPort, getRequests, getResolveNames, getReuseAddress, getServer, getSoLingerTime, getStatsOn, getStatsOnMs, getThreadPool, join, setAcceptorPriorityOffset, setAcceptors, setAcceptQueueSize, setConfidentialPort, setConfidentialScheme, setHost, setIntegralPort, setIntegralScheme, setName, setPort, setResolveNames, setReuseAddress, setServer, setSoLingerTime, setStatsOn, setThreadPool, statsReset, stopAccept, toString`

Methods inherited from class org.mortbay.jetty.AbstractBuffers
`getHeaderBufferSize, getRequestBufferSize, getResponseBufferSize, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSize`

Methods inherited from class org.mortbay.component.AbstractLifeCycle
`isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.mortbay.jetty.Connector
`getHeaderBufferSize, getRequestBufferSize, getResponseBufferSize, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSize`

Methods inherited from interface org.mortbay.component.LifeCycle
`isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop`

Field Detail

### 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

Constructor Detail

### SslSelectChannelConnector

    public SslSelectChannelConnector()

Method Detail

### getBuffer

    public Buffer getBuffer(int size)

  Specified by:
    `getBuffer` in interface `Buffers`
  Overrides:
    `getBuffer` in class `AbstractBuffers`

### returnBuffer

    public void returnBuffer(Buffer buffer)

  Specified by:
    `returnBuffer` in interface `Buffers`
  Overrides:
    `returnBuffer` in class `AbstractBuffers`

### 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()

  Deprecated. As of Java Servlet API 2.0, with no replacement.

### getExcludeCipherSuites

    public String[] getExcludeCipherSuites()

### setCipherSuites

    public void setCipherSuites(String[] cipherSuites)

  Deprecated. As of Java Servlet API 2.0, with no replacement.

### setExcludeCipherSuites

    public void setExcludeCipherSuites(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()

### getWantClientAuth

    public boolean getWantClientAuth()

### setNeedClientAuth

    public void setNeedClientAuth(boolean needClientAuth)

  Set the value of the needClientAuth property

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

### setWantClientAuth

    public void setWantClientAuth(boolean wantClientAuth)

### 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)

### isConfidential

    public boolean isConfidential(Request request)

  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 `Connector`
  Overrides:
    `isConfidential` in class `AbstractConnector`
  Parameters:
    `request` - A request
  Returns:
    true if the request is confidential. This normally means the https schema has been used.

### isIntegral

    public boolean isIntegral(Request request)

  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 `Connector`
  Overrides:
    `isIntegral` in class `AbstractConnector`
  Parameters:
    `request` - A request
  Returns:
    true if the request is integral. This normally means the https schema has been used.

### newEndPoint

    protected SelectChannelEndPoint newEndPoint(SocketChannel channel,
                                                SelectorManager.SelectSet selectSet,
                                                SelectionKey key)
                                         throws IOException

  Overrides:
    `newEndPoint` in class `SelectChannelConnector`
  Throws:
    `IOException`

### newConnection

    protected Connection newConnection(SocketChannel channel,
                                       SelectChannelEndPoint endpoint)

  Overrides:
    `newConnection` in class `SelectChannelConnector`

### createSSLEngine

    protected SSLEngine createSSLEngine()
                                 throws IOException

  Throws:
    `IOException`

### doStart

    protected void doStart()
                    throws Exception

  Overrides:
    `doStart` in class `SelectChannelConnector`
  Throws:
    `Exception`

### createSSLContext

    protected SSLContext createSSLContext()
                                   throws Exception

  Throws:
    `Exception`

Copyright © 2007 Mort Bay Consulting. All Rights Reserved.