|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tomcat.util.net.jsse.JSSESocketFactory
public class JSSESocketFactory
SSL server socket factory. It requires a valid RSA key and
JSSE.
keytool -genkey -alias tomcat -keyalg RSA
Use "changeit" as password (this is the default we use).
Field Summary | |
---|---|
protected boolean |
allowUnsafeLegacyRenegotiation
|
static String |
DEFAULT_KEY_PASS
|
protected String[] |
enabledCiphers
|
protected boolean |
requireClientAuth
Flag to state that we require client authentication. |
protected SSLServerSocketFactory |
sslProxy
|
protected boolean |
wantClientAuth
Flag to state that we would like client authentication. |
Constructor Summary | |
---|---|
JSSESocketFactory(AbstractEndpoint endpoint)
|
Method Summary | |
---|---|
Socket |
acceptSocket(ServerSocket socket)
Wrapper function for accept(). |
protected void |
configureClientAuth(SSLServerSocket socket)
Configure Client authentication for this version of JSSE. |
void |
configureSessionContext(SSLSessionContext sslSessionContext)
|
ServerSocket |
createSocket(int port)
Returns a server socket which uses all network interfaces on the host, and is bound to a the specified port. |
ServerSocket |
createSocket(int port,
int backlog)
Returns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog. |
ServerSocket |
createSocket(int port,
int backlog,
InetAddress ifAddress)
Returns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog. |
SSLContext |
createSSLContext()
|
protected Collection<? extends CRL> |
getCRLs(String crlf)
Load the collection of CRLs. |
protected String[] |
getEnabledCiphers(String requestedCiphers,
String[] supportedCiphers)
|
protected String[] |
getEnabledProtocols(SSLServerSocket socket,
String[] requestedProtocols)
Determines the SSL protocol variants to be enabled. |
KeyManager[] |
getKeyManagers()
|
protected KeyManager[] |
getKeyManagers(String keystoreType,
String keystoreProvider,
String algorithm,
String keyAlias)
Gets the initialized key managers. |
protected KeyStore |
getKeystore(String type,
String provider,
String pass)
|
protected String |
getKeystorePassword()
|
protected CertPathParameters |
getParameters(String algorithm,
String crlf,
KeyStore trustStore)
Return the initialization parameters for the TrustManager. |
TrustManager[] |
getTrustManagers()
|
protected TrustManager[] |
getTrustManagers(String keystoreType,
String keystoreProvider,
String algorithm)
Gets the initialized trust managers. |
protected KeyStore |
getTrustStore(String keystoreType,
String keystoreProvider)
|
void |
handshake(Socket sock)
Triggers the SSL handshake. |
protected void |
setEnabledProtocols(SSLServerSocket socket,
String[] protocols)
Set the SSL protocol variants to be enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_KEY_PASS
protected SSLServerSocketFactory sslProxy
protected String[] enabledCiphers
protected boolean allowUnsafeLegacyRenegotiation
protected boolean requireClientAuth
protected boolean wantClientAuth
Constructor Detail |
---|
public JSSESocketFactory(AbstractEndpoint endpoint)
Method Detail |
---|
public ServerSocket createSocket(int port) throws IOException
ServerSocketFactory
createSocket
in interface ServerSocketFactory
port
- the port to listen to
IOException
- for networking errorspublic ServerSocket createSocket(int port, int backlog) throws IOException
ServerSocketFactory
createSocket
in interface ServerSocketFactory
port
- the port to listen tobacklog
- how many connections are queued
IOException
- for networking errorspublic ServerSocket createSocket(int port, int backlog, InetAddress ifAddress) throws IOException
ServerSocketFactory
createSocket
in interface ServerSocketFactory
port
- the port to listen tobacklog
- how many connections are queuedifAddress
- the network interface address to use
IOException
- for networking errorspublic Socket acceptSocket(ServerSocket socket) throws IOException
ServerSocketFactory
acceptSocket
in interface ServerSocketFactory
IOException
public void handshake(Socket sock) throws IOException
ServerSocketFactory
handshake
in interface ServerSocketFactory
IOException
protected String[] getEnabledCiphers(String requestedCiphers, String[] supportedCiphers)
protected String getKeystorePassword()
protected KeyStore getKeystore(String type, String provider, String pass) throws IOException
IOException
protected KeyStore getTrustStore(String keystoreType, String keystoreProvider) throws IOException
IOException
public SSLContext createSSLContext() throws Exception
createSSLContext
in interface SSLUtil
Exception
public KeyManager[] getKeyManagers() throws Exception
getKeyManagers
in interface SSLUtil
Exception
public TrustManager[] getTrustManagers() throws Exception
getTrustManagers
in interface SSLUtil
Exception
public void configureSessionContext(SSLSessionContext sslSessionContext)
configureSessionContext
in interface SSLUtil
protected KeyManager[] getKeyManagers(String keystoreType, String keystoreProvider, String algorithm, String keyAlias) throws Exception
Exception
protected TrustManager[] getTrustManagers(String keystoreType, String keystoreProvider, String algorithm) throws Exception
Exception
protected CertPathParameters getParameters(String algorithm, String crlf, KeyStore trustStore) throws Exception
PKIX
is supported.
algorithm
- The algorithm to get parameters for.crlf
- The path to the CRL file.trustStore
- The configured TrustStore.
Exception
protected Collection<? extends CRL> getCRLs(String crlf) throws IOException, CRLException, CertificateException
IOException
CRLException
CertificateException
protected void setEnabledProtocols(SSLServerSocket socket, String[] protocols)
socket
- the SSLServerSocket.protocols
- the protocols to use.protected String[] getEnabledProtocols(SSLServerSocket socket, String[] requestedProtocols)
socket
- The socket to get supported list from.requestedProtocols
- Array of requested protocol names all of which
must be non-null and non-zero length
protected void configureClientAuth(SSLServerSocket socket)
socket
- the SSLServerSocket
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |