Package software.amazon.awssdk.crt.io
Class TlsConnectionOptions
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.io.TlsConnectionOptions
- All Implemented Interfaces:
AutoCloseable
Connection-specific TLS options.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance -
Constructor Summary
ConstructorsConstructorDescriptionTlsConnectionOptions(TlsContext tlsContext) Initialize the connection-specific TLS options with TLSContext. -
Method Summary
Modifier and TypeMethodDescriptionlongNote: Once this gets invoked the native resource will not be able to changed.withAlpnList(String alpnList) Sets alpn list in the form protocol1;protocol2;....withServerName(String serverName) Sets server name to use for the SNI extension (supported everywhere), as well as x.509 validation.withTimeoutMs(int timeoutMs) Set the TLS negotiation timeoutMethods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
TlsConnectionOptions
Initialize the connection-specific TLS options with TLSContext.- Parameters:
tlsContext- the TLS configuration contexts in the AWS Common Runtime.
-
-
Method Details
-
getNativeHandle
public long getNativeHandle()Note: Once this gets invoked the native resource will not be able to changed.- Overrides:
getNativeHandlein classCrtResource- Returns:
- native address
-
withAlpnList
Sets alpn list in the form protocol1;protocol2;.... A maximum of 4 protocols are supported. alpnList is copied. This value is already inherited from TlsContext, but the TlsContext is expensive, and should be used across as many connections as possible. If you want to set this per connection, set it here.- Parameters:
alpnList- Semi-colon delimited list of supported ALPN protocols- Returns:
- this
-
withServerName
Sets server name to use for the SNI extension (supported everywhere), as well as x.509 validation. If you don't set this, your x.509 validation will likely fail.- Parameters:
serverName- The server name to use for the SNI extension- Returns:
- this
-
withTimeoutMs
Set the TLS negotiation timeout- Parameters:
timeoutMs- The time out in ms- Returns:
- this
-