public class SslContextFactory extends Object
| Constructor and Description |
|---|
SslContextFactory() |
SslContextFactory(SslConfiguration sslConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkKeyStore()
Check KeyStore Configuration.
|
protected KeyManager[] |
getKeyManagers(KeyStore keyStore) |
protected KeyStore |
getKeyStore(InputStream storeStream,
String storePath,
String storeType,
String storeProvider,
String storePassword)
Loads keystore using an input stream or a file path in the same
order of precedence.
|
SSLContext |
getSslContext()
Get the underlying SSLContext.
|
protected TrustManager[] |
getTrustManagers(KeyStore trustStore,
Collection<? extends CRL> crls) |
protected Collection<? extends CRL> |
loadCRL(String crlPath)
Loads certificate revocation list (CRL) from a file.
|
protected KeyStore |
loadKeyStore()
Override this method to provide alternate way to load a keystore.
|
protected KeyStore |
loadTrustStore()
Override this method to provide alternate way to load a truststore.
|
SSLEngine |
newSslEngine()
Get an SSLEngine from this context.
|
SSLEngine |
newSslEngine(String host,
int port)
Get an SSLEngine from this context.
|
SSLServerSocket |
newSslServerSocket(String host,
int port,
int backlog) |
SSLSocket |
newSslSocket()
Get an SSLSocket from this context.
|
String[] |
selectCipherSuites(String[] enabledCipherSuites,
String[] supportedCipherSuites)
Select cipher suites to be used by the connector
based on configured inclusion and exclusion lists
as well as enabled and supported cipher suite lists.
|
String[] |
selectProtocols(String[] enabledProtocols,
String[] supportedProtocols)
Select cipher suites to be used by the connector
based on configured inclusion and exclusion lists
as well as enabled and supported cipher suite lists.
|
public SslContextFactory(SslConfiguration sslConfig) throws Exception
Exceptionpublic SSLContext getSslContext()
protected KeyStore loadKeyStore() throws Exception
Exceptionprotected KeyStore loadTrustStore() throws Exception
Exceptionprotected Collection<? extends CRL> loadCRL(String crlPath) throws Exception
crlPath - path of certificate revocation list fileExceptionprotected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception
storeStream - keystore input streamstorePath - path of keystore filestoreType - keystore typestoreProvider - keystore providerstorePassword - keystore passwordException - if the keystore cannot be obtainedprotected KeyManager[] getKeyManagers(KeyStore keyStore) throws Exception
Exceptionprotected TrustManager[] getTrustManagers(KeyStore trustStore, Collection<? extends CRL> crls) throws Exception
Exceptionpublic void checkKeyStore()
IllegalStateException - if SslContextFactory configuration can't be used.public String[] selectProtocols(String[] enabledProtocols, String[] supportedProtocols)
enabledCipherSuites - Array of enabled cipher suitessupportedCipherSuites - Array of supported cipher suitespublic String[] selectCipherSuites(String[] enabledCipherSuites, String[] supportedCipherSuites)
enabledCipherSuites - Array of enabled cipher suitessupportedCipherSuites - Array of supported cipher suitespublic SSLServerSocket newSslServerSocket(String host, int port, int backlog) throws IOException
IOExceptionpublic SSLSocket newSslSocket() throws IOException
SSLContext.getSocketFactory()IOExceptionpublic SSLEngine newSslEngine(String host, int port)
SSLContext.createSSLEngine(String,int)host - The non-authoritative name of the hostport - The non-authoritative portpublic SSLEngine newSslEngine()
SSLContext.createSSLEngine()Copyright © 2009-2014 Cloudhopper by Twitter. All Rights Reserved.