Class TlsConnectionOptions

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class TlsConnectionOptions
    extends CrtResource
    Connection-specific TLS options.
    • 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 class CrtResource
        Returns:
        native address
      • withAlpnList

        public TlsConnectionOptions withAlpnList​(java.lang.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​(java.lang.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