Class Tls
java.lang.Object
io.helidon.common.tls.Tls
- All Implemented Interfaces:
RuntimeType.Api<TlsConfig>
TLS configuration - common for server and client.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TlsConfig.Builderbuilder()A new fluent API builder.static TlsCreate TLS with custom configuration.static TlsCreate TLS configuration from config.static Tlscreate(Consumer<TlsConfig.Builder> consumer) Create TLS customizing its configuration.Create a TLS socket for a server.createSocket(List<String> alpnProtocols, Socket socket, String tlsPeerHost, int tlsPeerPort) Create a TLS socket using a logical peer identity and the configured server names.createSocket(List<String> alpnProtocols, Socket socket, String tlsPeerHost, int tlsPeerPort, List<SNIServerName> serverNamesOverride) Create a SSLSocket for the chosen protocol and the given socket.createSocket(List<String> alpnProtocols, Socket socket, InetSocketAddress address) Create a SSLSocket for the chosen protocol and the given socket.booleanenabled()Whether this TLS configuration is enabled or not.booleanlongGeneration of TLS material changes reported by the configuredTlsManager.generation().inthashCode()final SSLEngineSSL engine from this configuration.The prototype as it was received when creating this runtime object instance.voidDeprecated.voidreload(TlsMaterial material) Reload reloadableTlsReloadableComponents with new key and trust material.Provides the SSL context captured when this TLS instance was created.SSL parameters.
-
Field Details
-
ENDPOINT_IDENTIFICATION_HTTPS
HTTPS endpoint identification algorithm, verifies certificate cn against host name.- See Also:
-
ENDPOINT_IDENTIFICATION_NONE
-
-
Method Details
-
builder
-
create
-
create
-
create
Create TLS customizing its configuration.- Parameters:
consumer- configuration builder consumer- Returns:
- a new TLS instance
-
prototype
Description copied from interface:RuntimeType.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<TlsConfig>- Returns:
- prototype object used to create this instance
-
newEngine
-
hashCode
-
equals
-
createServerSocket
Create a TLS socket for a server.- Returns:
- a new server socket ready for TLS communication
-
createSocket
Create a SSLSocket for the chosen protocol and the given socket.- Parameters:
alpnProtocols- protocol(s) to use (order is significant)socket- existing socketaddress- where SSL socket will connect- Returns:
- a new socket ready for TLS communication
-
createSocket
public SSLSocket createSocket(List<String> alpnProtocols, Socket socket, String tlsPeerHost, int tlsPeerPort) Create a TLS socket using a logical peer identity and the configured server names.- Parameters:
alpnProtocols- protocol(s) to use (order is significant)socket- existing sockettlsPeerHost- TLS peer host for SNI and endpoint identificationtlsPeerPort- TLS peer port for endpoint identification- Returns:
- a new socket ready for TLS communication
-
createSocket
public SSLSocket createSocket(List<String> alpnProtocols, Socket socket, String tlsPeerHost, int tlsPeerPort, List<SNIServerName> serverNamesOverride) Create a SSLSocket for the chosen protocol and the given socket.- Parameters:
alpnProtocols- protocol(s) to use (order is significant)socket- existing sockettlsPeerHost- TLS peer host for SNI and endpoint identificationtlsPeerPort- TLS peer port for endpoint identificationserverNamesOverride- server names to use for this socket- Returns:
- a new socket ready for TLS communication
-
sslContext
Provides the SSL context captured when this TLS instance was created.- Returns:
- SSL context
-
sslParameters
SSL parameters. The returned parameters are a copy, and changing them does not modify this TLS configuration.- Returns:
- SSL parameters copy
-
reload
Deprecated.Reload reloadableTlsReloadableComponents with the new configuration.- Parameters:
tls- new TLS configuration
-
reload
Reload reloadableTlsReloadableComponents with new key and trust material.- Parameters:
material- new TLS material
-
generation
public long generation()Generation of TLS material changes reported by the configuredTlsManager.generation().For enabled TLS, this method returns the configured manager's generation. The generation after the manager's first successful initialization is zero. A custom manager that inherits the compatibility default continues to report zero after material changes and may therefore lag behind its current material. When TLS is disabled, this method also returns zero.
- Returns:
- current TLS material generation
-
enabled
public boolean enabled()Whether this TLS configuration is enabled or not.- Returns:
- whether TLS is enabled
-
reload(TlsMaterial)