Package software.amazon.awssdk.crt.io
Class TlsContext
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.io.TlsContext
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ClientTlsContext,ServerTlsContext
This class wraps the aws_tls_context from aws-c-io to provide
access to TLS configuration contexts in the AWS Common Runtime.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Client TlsContext.TlsContext(TlsContextOptions options) Creates a new Client TlsContext. -
Method Summary
Modifier and TypeMethodDescriptionReturns theTlsContextOptions.CertificateSourceof the configured mTLS, ornullif no mTLS source has been set on the options used to create this context.Returns theTlsCipherPreferenceconfigured on this context.Returns the minimumTLS versionconfigured on this context.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addRef, addReferenceTo, close, close, collectNativeResource, collectNativeResources, decRef, decRef, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
TlsContext
Creates a new Client TlsContext. There are significant native resources consumed to create a TlsContext, so most applications will only need to create one and re-use it for all connections.- Parameters:
options- A set of options for this context- Throws:
CrtRuntimeException- If the provided options are malformed or the system is unable to allocate space for a native tls context
-
TlsContext
Creates a new Client TlsContext. There are significant native resources consumed to create a TlsContext, so most applications will only need to create one and re-use it for all connections.- Throws:
CrtRuntimeException
-
-
Method Details
-
getCipherPreference
Returns theTlsCipherPreferenceconfigured on this context.- Returns:
- the cipher preference
-
getMinimumTlsVersion
Returns the minimumTLS versionconfigured on this context.- Returns:
- the minimum TLS version
-
getCertificateSource
Returns theTlsContextOptions.CertificateSourceof the configured mTLS, ornullif no mTLS source has been set on the options used to create this context.- Returns:
- the certificate source
-