public class SSLServer extends javax.net.ssl.SSLServerSocketFactory
Constructor and Description |
---|
SSLServer() |
Modifier and Type | Method and Description |
---|---|
void |
addAllowedName(java.lang.String s) |
void |
addAllowedNames(java.util.Collection c) |
void |
addTrustMaterial(TrustChain trustChain) |
void |
clearAllowedNames() |
java.net.ServerSocket |
createServerSocket() |
java.net.ServerSocket |
createServerSocket(int port) |
java.net.ServerSocket |
createServerSocket(int port,
int backlog) |
java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.net.InetAddress localHost)
Attempts to get a new socket connection to the given host within the
given time limit.
|
java.util.List |
getAllowedNames() |
java.security.cert.X509Certificate[] |
getAssociatedCertificateChain() |
boolean |
getCheckCRL() |
boolean |
getCheckExpiry() |
boolean |
getCheckHostname() |
int |
getConnectTimeout() |
java.security.cert.X509Certificate[] |
getCurrentClientChain() |
java.lang.String[] |
getDefaultCipherSuites() |
java.lang.String |
getDefaultProtocol() |
java.lang.String[] |
getEnabledCiphers() |
java.lang.String[] |
getEnabledProtocols() |
HostnameVerifier |
getHostnameVerifier() |
boolean |
getNeedClientAuth() |
int |
getSoTimeout() |
javax.net.ssl.SSLContext |
getSSLContext() |
SSLWrapperFactory |
getSSLWrapperFactory() |
java.lang.String[] |
getSupportedCipherSuites() |
TrustChain |
getTrustChain() |
boolean |
getUseClientMode() |
boolean |
getWantClientAuth() |
void |
setCheckCRL(boolean b) |
void |
setCheckExpiry(boolean b) |
void |
setCheckHostname(boolean b) |
void |
setConnectTimeout(int i) |
void |
setDefaultProtocol(java.lang.String s) |
void |
setEnabledCiphers(java.lang.String[] ciphers) |
void |
setEnabledProtocols(java.lang.String[] protocols) |
void |
setHostnameVerifier(HostnameVerifier verifier) |
void |
setKeyMaterial(KeyMaterial keyMaterial) |
void |
setNeedClientAuth(boolean b) |
void |
setSoTimeout(int soTimeout) |
void |
setSSLWrapperFactory(SSLWrapperFactory wf) |
void |
setTrustMaterial(TrustChain trustChain) |
void |
setUseClientMode(boolean b) |
void |
setWantClientAuth(boolean b) |
void |
useDefaultJavaCiphers() |
private boolean |
useDefaultKeyMaterial() |
void |
useStrongCiphers() |
boolean |
useTomcatSSLMaterial()
Tries to extract the TrustMaterial and KeyMaterial being used by a Tomcat
SSL server (usually on 8443) by analyzing Tomcat's "server.xml" file.
|
public SSLServer() throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public boolean useTomcatSSLMaterial() throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
- setKeyMaterial() failedjava.io.IOException
- setKeyMaterial() failedprivate boolean useDefaultKeyMaterial() throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public void addTrustMaterial(TrustChain trustChain) throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException, java.security.KeyManagementException, java.io.IOException, java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
java.io.IOException
java.security.cert.CertificateException
public void setTrustMaterial(TrustChain trustChain) throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException, java.security.KeyManagementException, java.io.IOException, java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
java.io.IOException
java.security.cert.CertificateException
public void setKeyMaterial(KeyMaterial keyMaterial) throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException, java.security.KeyManagementException, java.io.IOException, java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
java.io.IOException
java.security.cert.CertificateException
public void addAllowedName(java.lang.String s)
public void addAllowedNames(java.util.Collection c)
public void clearAllowedNames()
public void setCheckCRL(boolean b)
public void setCheckExpiry(boolean b)
public void setCheckHostname(boolean b)
public void setConnectTimeout(int i)
public void setDefaultProtocol(java.lang.String s)
public void useDefaultJavaCiphers()
public void useStrongCiphers()
public void setEnabledCiphers(java.lang.String[] ciphers)
public void setEnabledProtocols(java.lang.String[] protocols)
public void setHostnameVerifier(HostnameVerifier verifier)
public void setSoTimeout(int soTimeout)
public void setSSLWrapperFactory(SSLWrapperFactory wf)
public void setNeedClientAuth(boolean b)
public void setWantClientAuth(boolean b)
public void setUseClientMode(boolean b)
public java.util.List getAllowedNames()
public java.security.cert.X509Certificate[] getAssociatedCertificateChain()
public boolean getCheckCRL()
public boolean getCheckExpiry()
public boolean getCheckHostname()
public int getConnectTimeout()
public java.lang.String getDefaultProtocol()
public java.lang.String[] getEnabledCiphers()
public java.lang.String[] getEnabledProtocols()
public HostnameVerifier getHostnameVerifier()
public int getSoTimeout()
public SSLWrapperFactory getSSLWrapperFactory()
public boolean getNeedClientAuth()
public boolean getWantClientAuth()
public boolean getUseClientMode()
public javax.net.ssl.SSLContext getSSLContext() throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public TrustChain getTrustChain()
public java.security.cert.X509Certificate[] getCurrentClientChain()
public java.lang.String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class javax.net.ssl.SSLServerSocketFactory
public java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class javax.net.ssl.SSLServerSocketFactory
public java.net.ServerSocket createServerSocket() throws java.io.IOException
createServerSocket
in class javax.net.ServerSocketFactory
java.io.IOException
public java.net.ServerSocket createServerSocket(int port) throws java.io.IOException
createServerSocket
in class javax.net.ServerSocketFactory
java.io.IOException
public java.net.ServerSocket createServerSocket(int port, int backlog) throws java.io.IOException
createServerSocket
in class javax.net.ServerSocketFactory
java.io.IOException
public java.net.ServerSocket createServerSocket(int port, int backlog, java.net.InetAddress localHost) throws java.io.IOException
createServerSocket
in class javax.net.ServerSocketFactory
localHost
- the local host name/IP to bind against (null == ANY)port
- the port to listen onbacklog
- number of connections allowed to queue up for accept().java.io.IOException
- if an I/O error occurs while creating thesocket