Package org.jboss.netty.handler.ssl
Class JdkSslClientContext
- java.lang.Object
-
- org.jboss.netty.handler.ssl.SslContext
-
- org.jboss.netty.handler.ssl.JdkSslContext
-
- org.jboss.netty.handler.ssl.JdkSslClientContext
-
public final class JdkSslClientContext extends JdkSslContext
A client-sideSslContext
which uses JDK's SSL/TLS implementation.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.net.ssl.SSLContext
ctx
private java.util.List<java.lang.String>
nextProtocols
-
Fields inherited from class org.jboss.netty.handler.ssl.JdkSslContext
DEFAULT_CIPHERS, PROTOCOL, PROTOCOLS
-
-
Constructor Summary
Constructors Constructor Description JdkSslClientContext()
Creates a new instance.JdkSslClientContext(java.io.File certChainFile)
Creates a new instance.JdkSslClientContext(java.io.File certChainFile, javax.net.ssl.TrustManagerFactory trustManagerFactory)
Creates a new instance.JdkSslClientContext(javax.net.ssl.TrustManagerFactory trustManagerFactory)
Creates a new instance.JdkSslClientContext(SslBufferPool bufPool, java.io.File certChainFile, javax.net.ssl.TrustManagerFactory trustManagerFactory, java.lang.Iterable<java.lang.String> ciphers, java.lang.Iterable<java.lang.String> nextProtocols, long sessionCacheSize, long sessionTimeout)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.net.ssl.SSLContext
context()
Returns the JDKSSLContext
object held by this context.boolean
isClient()
Returns thetrue
if and only if this context is for client-side.java.util.List<java.lang.String>
nextProtocols()
Returns the list of application layer protocols for the TLS NPN/ALPN extension, in the order of preference.-
Methods inherited from class org.jboss.netty.handler.ssl.JdkSslContext
cipherSuites, newEngine, newEngine, sessionCacheSize, sessionContext, sessionTimeout
-
Methods inherited from class org.jboss.netty.handler.ssl.SslContext
bufferPool, defaultClientProvider, defaultServerProvider, isServer, newBufferPool, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newHandler, newHandler, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext
-
-
-
-
Constructor Detail
-
JdkSslClientContext
public JdkSslClientContext() throws javax.net.ssl.SSLException
Creates a new instance.- Throws:
javax.net.ssl.SSLException
-
JdkSslClientContext
public JdkSslClientContext(java.io.File certChainFile) throws javax.net.ssl.SSLException
Creates a new instance.- Parameters:
certChainFile
- an X.509 certificate chain file in PEM format.null
to use the system default- Throws:
javax.net.ssl.SSLException
-
JdkSslClientContext
public JdkSslClientContext(javax.net.ssl.TrustManagerFactory trustManagerFactory) throws javax.net.ssl.SSLException
Creates a new instance.- Parameters:
trustManagerFactory
- theTrustManagerFactory
that provides theTrustManager
s that verifies the certificates sent from servers.null
to use the default.- Throws:
javax.net.ssl.SSLException
-
JdkSslClientContext
public JdkSslClientContext(java.io.File certChainFile, javax.net.ssl.TrustManagerFactory trustManagerFactory) throws javax.net.ssl.SSLException
Creates a new instance.- Parameters:
certChainFile
- an X.509 certificate chain file in PEM format.null
to use the system defaulttrustManagerFactory
- theTrustManagerFactory
that provides theTrustManager
s that verifies the certificates sent from servers.null
to use the default.- Throws:
javax.net.ssl.SSLException
-
JdkSslClientContext
public JdkSslClientContext(SslBufferPool bufPool, java.io.File certChainFile, javax.net.ssl.TrustManagerFactory trustManagerFactory, java.lang.Iterable<java.lang.String> ciphers, java.lang.Iterable<java.lang.String> nextProtocols, long sessionCacheSize, long sessionTimeout) throws javax.net.ssl.SSLException
Creates a new instance.- Parameters:
bufPool
- the buffer pool which will be used by this context.null
to use the default buffer pool.certChainFile
- an X.509 certificate chain file in PEM format.null
to use the system defaulttrustManagerFactory
- theTrustManagerFactory
that provides theTrustManager
s that verifies the certificates sent from servers.null
to use the default.ciphers
- the cipher suites to enable, in the order of preference.null
to use the default cipher suites.nextProtocols
- the application layer protocols to accept, in the order of preference.null
to disable TLS NPN/ALPN extension.sessionCacheSize
- the size of the cache used for storing SSL session objects.0
to use the default value.sessionTimeout
- the timeout for the cached SSL session objects, in seconds.0
to use the default value.- Throws:
javax.net.ssl.SSLException
-
-
Method Detail
-
isClient
public boolean isClient()
Description copied from class:SslContext
Returns thetrue
if and only if this context is for client-side.- Specified by:
isClient
in classSslContext
-
nextProtocols
public java.util.List<java.lang.String> nextProtocols()
Description copied from class:SslContext
Returns the list of application layer protocols for the TLS NPN/ALPN extension, in the order of preference.- Specified by:
nextProtocols
in classSslContext
- Returns:
- the list of application layer protocols.
null
if NPN/ALPN extension has been disabled.
-
context
public javax.net.ssl.SSLContext context()
Description copied from class:JdkSslContext
Returns the JDKSSLContext
object held by this context.- Specified by:
context
in classJdkSslContext
-
-