public class SslContextProviders extends Object
SslContextProvider.| Modifier and Type | Method and Description |
|---|---|
static SslContextProvider |
forClient(File trustCertCollectionFile)
Returns a simple implementation of
SslContextProvider which holding
an SslContext trusted certificates for verifying the remote
endpoint's certificate. |
static SslContextProvider |
forServer(File keyCertChainFile,
File keyFile)
|
static SslContextProvider |
forServer(File keyCertChainFile,
File keyFile,
String keyPassword)
|
static SslContextProvider |
insecureForClient()
Returns a simple implementation of
SslContextProvider which holding
an insecure SslContext for client. |
static SslContextProvider |
selfSignedForServer()
Returns a simple implementation of
SslContextProvider which holding a
self-signed certificate SslContext for server. |
static SslContextProvider |
simple(io.netty.handler.ssl.SslContext sslContext)
Returns a simple implementation of
SslContextProvider which just
holding the specified SslContext. |
static SslContextProvider |
watchingForServer(File keyCertChainFile,
File keyFile)
Returns an
SslContextProvider which will auto rebuild
SslContext when the watching certificate file just be modified. |
public static final SslContextProvider selfSignedForServer() throws SSLRuntimeException
SslContextProvider which holding a
self-signed certificate SslContext for server.SslContextProvider holding a self-signed certificate
SslContext for serverSSLRuntimeException - if any SSL error occurspublic static final SslContextProvider forServer(File keyCertChainFile, File keyFile) throws SSLRuntimeException
keyCertChainFile - an X.509 certificate chain file in PEM formatkeyFile - a PKCS#8 private key file in PEM formatSslContextProviderSSLRuntimeException - if any SSL error occursforServer(File, File, String)public static final SslContextProvider forServer(File keyCertChainFile, File keyFile, String keyPassword) throws SSLRuntimeException
keyCertChainFile - an X.509 certificate chain file in PEM formatkeyFile - a PKCS#8 private key file in PEM formatkeyPassword - the password of the keyFile, or null
if it's not password-protectedSslContextProviderSSLRuntimeException - if any SSL error occursforServer(File, File)public static final SslContextProvider watchingForServer(File keyCertChainFile, File keyFile) throws SSLRuntimeException, IOException
SslContextProvider which will auto rebuild
SslContext when the watching certificate file just be modified.keyCertChainFile - an X.509 certificate chain file in PEM formatkeyFile - a PKCS#8 private key file in PEM formatSslContextProviderSSLRuntimeException - if any SSL error occursIOException - if any IO error occurspublic static final SslContextProvider insecureForClient() throws SSLRuntimeException
SslContextProvider which holding
an insecure SslContext for client.SslContextProvider holding insecure SslContext for
clientSSLRuntimeException - if any SSL error occurspublic static final SslContextProvider forClient(File trustCertCollectionFile) throws SSLRuntimeException
SslContextProvider which holding
an SslContext trusted certificates for verifying the remote
endpoint's certificate.
The file should contain an X.509 certificate collection in PEM format.
trustCertCollectionFile - file contains an X.509 certificate collection
in PEM formatSslContextProviderSSLRuntimeException - if any SSL error occurspublic static final SslContextProvider simple(io.netty.handler.ssl.SslContext sslContext)
SslContextProvider which just
holding the specified SslContext.sslContext - a SslContextSslContextProviderCopyright © 2020. All rights reserved.