Class QuicSslContextBuilder
java.lang.Object
io.netty.handler.codec.quic.QuicSslContextBuilder
Builder for configuring a new SslContext for creation.
-
Method Summary
Modifier and TypeMethodDescriptionapplicationProtocols(String @Nullable ... applicationProtocols) Application protocol negotiation configuration.build()Create newQuicSslContextinstance with configured settings that can be used forQUIC.static QuicSslContextbuildForServerWithSni(Mapping<? super String, ? extends QuicSslContext> mapping) Enables support for SNI on the server side.clientAuth(ClientAuth clientAuth) Sets the client authentication mode.earlyData(boolean enabled) Enable / disable the usage of early data.static QuicSslContextBuilderCreates a builder for new client-sideQuicSslContextthat can be used forQUIC.static QuicSslContextBuilderCreates a builder for new server-sideQuicSslContextthat can be used forQUIC.static QuicSslContextBuilderforServer(PrivateKey key, @Nullable String keyPassword, X509Certificate... certChain) Creates a builder for new server-sideQuicSslContextthat can be used forQUIC.static QuicSslContextBuilderforServer(KeyManagerFactory keyManagerFactory, @Nullable String password) Creates a builder for new server-sideQuicSslContextthat can be used forQUIC.static QuicSslContextBuilderforServer(KeyManager keyManager, @Nullable String keyPassword) keylog(boolean enabled) Enable / disable keylog.keylog(@Nullable BoringSSLKeylog keylog) Enable / disable keylog.keyManager(@Nullable File keyFile, @Nullable String keyPassword, @Nullable File keyCertChainFile) Identifying certificate for this host.keyManager(@Nullable PrivateKey key, @Nullable String keyPassword, X509Certificate @Nullable ... certChain) Identifying certificate for this host.keyManager(@Nullable KeyManagerFactory keyManagerFactory, @Nullable String keyPassword) Identifying manager for this host.keyManager(KeyManager keyManager, @Nullable String password) A single key manager managing the identity information of this host.option(SslContextOption<T> option, T value) Configure aSslContextOption.sessionCacheSize(long sessionCacheSize) Set the size of the cache used for storing SSL session objects.sessionTimeout(long sessionTimeout) Set the timeout for the cached SSL session objects, in seconds.trustManager(@Nullable File trustCertCollectionFile) Trusted certificates for verifying the remote endpoint's certificate.trustManager(X509Certificate @Nullable ... trustCertCollection) Trusted certificates for verifying the remote endpoint's certificate.trustManager(@Nullable TrustManagerFactory trustManagerFactory) Trusted manager for verifying the remote endpoint's certificate.trustManager(TrustManager trustManager) A single trusted manager for verifying the remote endpoint's certificate.
-
Method Details
-
forClient
Creates a builder for new client-sideQuicSslContextthat can be used forQUIC. -
forServer
public static QuicSslContextBuilder forServer(File keyFile, @Nullable @Nullable String keyPassword, File certChainFile) Creates a builder for new server-sideQuicSslContextthat can be used forQUIC.- Parameters:
keyFile- a PKCS#8 private key file in PEM formatkeyPassword- the password of thekeyFile, ornullif it's not password-protectedcertChainFile- an X.509 certificate chain file in PEM format- See Also:
-
forServer
public static QuicSslContextBuilder forServer(PrivateKey key, @Nullable @Nullable String keyPassword, X509Certificate... certChain) Creates a builder for new server-sideQuicSslContextthat can be used forQUIC.- Parameters:
key- a PKCS#8 private keykeyPassword- the password of thekeyFile, ornullif it's not password-protectedcertChain- the X.509 certificate chain- See Also:
-
forServer
public static QuicSslContextBuilder forServer(KeyManagerFactory keyManagerFactory, @Nullable @Nullable String password) Creates a builder for new server-sideQuicSslContextthat can be used forQUIC.- Parameters:
keyManagerFactory- non-nullfactory for server's private key- See Also:
-
forServer
public static QuicSslContextBuilder forServer(KeyManager keyManager, @Nullable @Nullable String keyPassword) - Parameters:
keyManager- non-nullKeyManager for server's private keykeyPassword- the password of thekeyFile, ornullif it's not password-protected
-
buildForServerWithSni
public static QuicSslContext buildForServerWithSni(Mapping<? super String, ? extends QuicSslContext> mapping) Enables support for SNI on the server side.- Parameters:
mapping- theMappingthat is used to map names to theQuicSslContextto use. Usually usingDomainWildcardMappingBuildershould be used to create theMapping.
-
option
Configure aSslContextOption. -
earlyData
Enable / disable the usage of early data. -
keylog
Enable / disable keylog. When enabled, TLS keys are logged to an internal logger named "io.netty.handler.codec.quic.BoringSSLLogginKeylog" with DEBUG level, seeBoringSSLKeylogfor detail, logging keys are following NSS Key Log Format. This is intended for debugging use with tools like Wireshark. -
keylog
Enable / disable keylog. When enabled, TLS keys are logged toBoringSSLKeylog.logKey(SSLEngine, String)logging keys are following NSS Key Log Format. This is intended for debugging use with tools like Wireshark. -
trustManager
Trusted certificates for verifying the remote endpoint's certificate. The file should contain an X.509 certificate collection in PEM format.nulluses the system default which only works with Java 8u261 and later as these versions support TLS1.3, see JDK 8u261 Update Release Notes -
trustManager
Trusted certificates for verifying the remote endpoint's certificate.nulluses the system default which only works with Java 8u261 and later as these versions support TLS1.3, see JDK 8u261 Update Release Notes -
trustManager
public QuicSslContextBuilder trustManager(@Nullable @Nullable TrustManagerFactory trustManagerFactory) Trusted manager for verifying the remote endpoint's certificate.nulluses the system default which only works with Java 8u261 and later as these versions support TLS1.3, see JDK 8u261 Update Release Notes -
trustManager
A single trusted manager for verifying the remote endpoint's certificate. This is helpful when custom implementation ofTrustManageris needed. Internally, a simple wrapper ofTrustManagerFactorythat only produces this specifiedTrustManagerwill be created, thus all the requirements specified intrustManager(TrustManagerFactory trustManagerFactory)also apply here. -
keyManager
public QuicSslContextBuilder keyManager(@Nullable @Nullable File keyFile, @Nullable @Nullable String keyPassword, @Nullable @Nullable File keyCertChainFile) Identifying certificate for this host.keyCertChainFileandkeyFilemay benullfor client contexts, which disables mutual authentication.- Parameters:
keyFile- a PKCS#8 private key file in PEM formatkeyPassword- the password of thekeyFile, ornullif it's not password-protectedkeyCertChainFile- an X.509 certificate chain file in PEM format
-
keyManager
public QuicSslContextBuilder keyManager(@Nullable @Nullable PrivateKey key, @Nullable @Nullable String keyPassword, X509Certificate @Nullable ... certChain) Identifying certificate for this host.keyCertChainandkeymay benullfor client contexts, which disables mutual authentication.- Parameters:
key- a PKCS#8 private key filekeyPassword- the password of thekey, ornullif it's not password-protectedcertChain- an X.509 certificate chain
-
keyManager
public QuicSslContextBuilder keyManager(@Nullable @Nullable KeyManagerFactory keyManagerFactory, @Nullable @Nullable String keyPassword) Identifying manager for this host.keyManagerFactorymay benullfor client contexts, which disables mutual authentication. -
keyManager
A single key manager managing the identity information of this host. This is helpful when custom implementation ofKeyManageris needed. Internally, a wrapper ofKeyManagerFactorythat only produces this specifiedKeyManagerwill be created, thus all the requirements specified inkeyManager(KeyManagerFactory, String)also apply here. -
applicationProtocols
Application protocol negotiation configuration.nulldisables support. -
sessionCacheSize
Set the size of the cache used for storing SSL session objects.0to use the default value. -
sessionTimeout
Set the timeout for the cached SSL session objects, in seconds.0to use the default value. -
clientAuth
Sets the client authentication mode. -
build
Create newQuicSslContextinstance with configured settings that can be used forQUIC.
-