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
public class TlsConnectionOptions extends CrtResource
Connection-specific TLS options.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Constructor Summary
Constructors Constructor Description TlsConnectionOptions(TlsContext tlsContext)
Initialize the connection-specific TLS options with TLSContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getNativeHandle()
Note: Once this gets invoked the native resource will not be able to changed.TlsConnectionOptions
withAlpnList(String alpnList)
Sets alpn list in the form protocol1;protocol2;....TlsConnectionOptions
withServerName(String serverName)
Sets server name to use for the SNI extension (supported everywhere), as well as x.509 validation.TlsConnectionOptions
withTimeoutMs(int timeoutMs)
Set the TLS negotiation timeout-
Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
-
-
-
Constructor Detail
-
TlsConnectionOptions
public TlsConnectionOptions(TlsContext tlsContext)
Initialize the connection-specific TLS options with TLSContext.- Parameters:
tlsContext
- the TLS configuration contexts in the AWS Common Runtime.
-
-
Method Detail
-
getNativeHandle
public long getNativeHandle()
Note: Once this gets invoked the native resource will not be able to changed.- Overrides:
getNativeHandle
in classCrtResource
- Returns:
- native address
-
withAlpnList
public TlsConnectionOptions withAlpnList(String alpnList)
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
public TlsConnectionOptions withServerName(String serverName)
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
public TlsConnectionOptions withTimeoutMs(int timeoutMs)
Set the TLS negotiation timeout- Parameters:
timeoutMs
- The time out in ms- Returns:
- this
-
-