|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.http.HttpBuffers org.eclipse.jetty.server.AbstractConnector org.eclipse.jetty.server.bio.SocketConnector org.eclipse.jetty.server.ssl.SslSocketConnector
public class SslSocketConnector
SSL Socket Connector. This specialization of SocketConnector is an abstract listener that can be used as the basis for a specific JSSE listener. The original of this class was heavily based on the work from Court Demas, which in turn is based on the work from Forge Research. Since JSSE, this class has evolved significantly from that early work.
Nested Class Summary | |
---|---|
class |
SslSocketConnector.SslConnection
|
Nested classes/interfaces inherited from class org.eclipse.jetty.server.bio.SocketConnector |
---|
SocketConnector.Connection |
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary |
---|
Fields inherited from class org.eclipse.jetty.server.bio.SocketConnector |
---|
_connections, _serverSocket |
Fields inherited from class org.eclipse.jetty.server.AbstractConnector |
---|
_lowResourceMaxIdleTime, _maxIdleTime, _soLingerTime |
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Fields inherited from interface org.eclipse.jetty.server.ssl.SslConnector |
---|
DEFAULT_KEYSTORE, KEYPASSWORD_PROPERTY, PASSWORD_PROPERTY |
Constructor Summary | |
---|---|
SslSocketConnector()
Constructor. |
Method Summary | |
---|---|
void |
accept(int acceptorID)
|
protected void |
configure(Socket socket)
|
protected SSLServerSocketFactory |
createFactory()
|
protected SSLContext |
createSSLContext()
|
void |
customize(EndPoint endpoint,
Request request)
Allow the Listener a chance to customise the request. |
String |
getAlgorithm()
Unsupported. |
String[] |
getExcludeCipherSuites()
|
int |
getHandshakeTimeout()
|
protected KeyManager[] |
getKeyManagers()
|
String |
getKeystore()
|
protected KeyStore |
getKeyStore(String keystorePath,
String keystoreType,
String keystorePassword)
|
String |
getKeystoreType()
|
boolean |
getNeedClientAuth()
|
String |
getProtocol()
|
String |
getProvider()
|
String |
getSecureRandomAlgorithm()
|
SSLContext |
getSslContext()
|
String |
getSslKeyManagerFactoryAlgorithm()
|
String |
getSslTrustManagerFactoryAlgorithm()
|
protected TrustManager[] |
getTrustManagers()
|
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 ServerSocket |
newServerSocket(String host,
int port,
int backlog)
|
void |
setAlgorithm(String algorithm)
Unsupported. |
void |
setExcludeCipherSuites(String[] cipherSuites)
|
void |
setHandshakeTimeout(int msec)
Set the time in milliseconds for so_timeout during ssl handshaking |
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 |
setSslContext(SSLContext sslContext)
|
void |
setSslKeyManagerFactoryAlgorithm(String algorithm)
|
void |
setSslTrustManagerFactoryAlgorithm(String algorithm)
|
void |
setTrustPassword(String password)
|
void |
setTruststore(String truststore)
|
void |
setTruststoreType(String truststoreType)
|
void |
setWantClientAuth(boolean wantClientAuth)
Set the value of the _wantClientAuth property. |
Methods inherited from class org.eclipse.jetty.server.bio.SocketConnector |
---|
close, doStart, doStop, getConnection, getLocalPort, newHttpConnection, open |
Methods inherited from class org.eclipse.jetty.http.HttpBuffers |
---|
getHeaderBufferSize, getRequestBuffers, getRequestBufferSize, getRequestHeaderSize, getResponseBuffers, getResponseBufferSize, getResponseHeaderSize, setHeaderBufferSize, setRequestBufferSize, setRequestHeaderSize, setResponseBufferSize, setResponseHeaderSize |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Constructor Detail |
---|
public SslSocketConnector()
Method Detail |
---|
public void accept(int acceptorID) throws IOException, InterruptedException
accept
in class SocketConnector
IOException
InterruptedException
protected void configure(Socket socket) throws IOException
configure
in class AbstractConnector
IOException
protected SSLContext createSSLContext() throws Exception
Exception
protected SSLServerSocketFactory createFactory() throws Exception
Exception
protected KeyManager[] getKeyManagers() throws Exception
Exception
protected TrustManager[] getTrustManagers() throws Exception
Exception
protected KeyStore getKeyStore(String keystorePath, String keystoreType, String keystorePassword) throws Exception
Exception
public void customize(EndPoint endpoint, Request request) throws IOException
customize
in interface Connector
customize
in class SocketConnector
endpoint
- The Socket the request arrived on.
This should be a SocketEndPoint
wrapping a SSLSocket
.request
- HttpRequest to be customised.
IOException
public String[] getExcludeCipherSuites()
getExcludeCipherSuites
in interface SslConnector
SSLEngine.setEnabledCipherSuites(String[])
public String getKeystore()
getKeystore
in interface SslConnector
public String getKeystoreType()
getKeystoreType
in interface SslConnector
public boolean getNeedClientAuth()
getNeedClientAuth
in interface SslConnector
SSLEngine.getNeedClientAuth()
public String getProtocol()
getProtocol
in interface SslConnector
SSLContext.getInstance(String, String)
public String getProvider()
getProvider
in interface SslConnector
SSLContext.getInstance(String, String)
public String getSecureRandomAlgorithm()
getSecureRandomAlgorithm
in interface SslConnector
SecureRandom.getInstance(String)
to obtain the SecureRandom
instance passed to SSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], SecureRandom)
public String getSslKeyManagerFactoryAlgorithm()
getSslKeyManagerFactoryAlgorithm
in interface SslConnector
KeyManagerFactory
public String getSslTrustManagerFactoryAlgorithm()
getSslTrustManagerFactoryAlgorithm
in interface SslConnector
TrustManagerFactory
public String getTruststore()
getTruststore
in interface SslConnector
public String getTruststoreType()
getTruststoreType
in interface SslConnector
public boolean getWantClientAuth()
getWantClientAuth
in interface SslConnector
SSLEngine.getWantClientAuth()
public boolean isConfidential(Request request)
isConfidential
in interface Connector
isConfidential
in class AbstractConnector
request
- A request
public boolean isIntegral(Request request)
isIntegral
in interface Connector
isIntegral
in class AbstractConnector
request
- A request
protected ServerSocket newServerSocket(String host, int port, int backlog) throws IOException
newServerSocket
in class SocketConnector
addr
- The address
that this server should listen onbacklog
- See ServerSocket.bind(java.net.SocketAddress, int)
socket object
bound to the supplied address with all other
settings as per the current configuration of this connector.
IOException
setWantClientAuth(boolean)
,
setNeedClientAuth(boolean)
,
#setCipherSuites
public void setExcludeCipherSuites(String[] cipherSuites)
setExcludeCipherSuites
in interface SslConnector
cipherSuites
- The array of Ciphersuite names to exclude from
SSLEngine.setEnabledCipherSuites(String[])
public void setKeyPassword(String password)
setKeyPassword
in interface SslConnector
password
- The password (if any) for the specific key within
the key storepublic void setKeystore(String keystore)
setKeystore
in interface SslConnector
keystore
- The resource path to the keystore, or null for built in keystores.public void setKeystoreType(String keystoreType)
setKeystoreType
in interface SslConnector
keystoreType
- The type of the key store (default "JKS")public void setNeedClientAuth(boolean needClientAuth)
setNeedClientAuth
in interface SslConnector
needClientAuth
- true iff we require client certificate authentication.SSLEngine.getNeedClientAuth()
public void setPassword(String password)
setPassword
in interface SslConnector
password
- The password for the key storepublic void setTrustPassword(String password)
setTrustPassword
in interface SslConnector
password
- The password for the trust storepublic void setProtocol(String protocol)
setProtocol
in interface SslConnector
protocol
- The SSL protocol (default "TLS") passed to SSLContext.getInstance(String, String)
public void setProvider(String _provider)
setProvider
in interface SslConnector
_provider
- The SSL provider name, which if set is passed to
SSLContext.getInstance(String, String)
public void setSecureRandomAlgorithm(String algorithm)
setSecureRandomAlgorithm
in interface SslConnector
algorithm
- The algorithm name, which if set is passed to
SecureRandom.getInstance(String)
to obtain the SecureRandom
instance passed to SSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], SecureRandom)
public void setSslKeyManagerFactoryAlgorithm(String algorithm)
setSslKeyManagerFactoryAlgorithm
in interface SslConnector
algorithm
- The algorithm name (default "SunX509") used by
the KeyManagerFactory
public void setSslTrustManagerFactoryAlgorithm(String algorithm)
setSslTrustManagerFactoryAlgorithm
in interface SslConnector
algorithm
- The algorithm name (default "SunX509") used by the TrustManagerFactory
public void setTruststore(String truststore)
setTruststore
in interface SslConnector
truststore
- The file name or URL of the trust store locationpublic void setTruststoreType(String truststoreType)
setTruststoreType
in interface SslConnector
truststoreType
- The type of the trust store (default "JKS")public void setSslContext(SSLContext sslContext)
setSslContext
in interface SslConnector
sslContext
- Set a preconfigured SSLContextpublic SSLContext getSslContext()
getSslContext
in interface SslConnector
Exception
SslConnector.setSslContext(javax.net.ssl.SSLContext)
public void setWantClientAuth(boolean wantClientAuth)
opening server sockets
.
setWantClientAuth
in interface SslConnector
wantClientAuth
- true iff we want client certificate authentication.SSLServerSocket.setWantClientAuth(boolean)
public void setHandshakeTimeout(int msec)
msec
- a non-zero value will be used to set so_timeout during
ssl handshakes. A zero value means the maxIdleTime is used instead.public int getHandshakeTimeout()
public String getAlgorithm()
org.eclipse.jetty.server.ssl.SslConnector#getAlgorithm()
public void setAlgorithm(String algorithm)
org.eclipse.jetty.server.ssl.SslConnector#setAlgorithm(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |