Repository navigation
Conversation
zoewangg
commented
Oct 16, 2026
Add an opt-in useTrustStoreSystemProperties option to the sync and async CRT client builders. When enabled, the client trusts the store named by the javax.net.ssl.trustStore* properties instead of the OS trust store. Requires aws-crt 0.49.0. Handshake-failure tests use a short acquisition timeout because s2n reports a rejected certificate only after its 10-30s blinding delay.
joviegas
reviewed
Oct 16, 2026
zoewangg
force-pushed
the
zoewang/crt-jsse-truststore-opt-in
branch
from
October 16, 2026 23:06
793f9a3 to
fdcf53e
Compare
The CRT gives no signal when javax.net.ssl.trustStore is unset, so wrapping TlsContext failures whenever the option was on made the exception type depend on the option even when no Java trust store was loaded. Let CrtRuntimeException propagate as it does with the option off.
joviegas
approved these changes
Oct 19, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The Apache, Netty, and URL connection HTTP clients trust the trust store configured by the standard
javax.net.ssl.trustStore*system properties, because they use the JDK's TLS implementation. The AWS CRT HTTP clients use native TLS and always trust the OS trust store, so applications that rely onjavax.net.ssl.trustStorefor a custom CA can fail TLS handshakes after moving to the CRT clients.awslabs/aws-crt-java#1017 adds
TlsContextOptions.overrideDefaultTrustStoreFromJavaSystemProperties(), which loads the configured Java keystore and uses its certificates in place of the OS trust store. This change exposes it through an opt-in builder option.Modifications
useTrustStoreSystemProperties(Boolean)onAwsCrtHttpClient.BuilderandAwsCrtAsyncHttpClient.Builder. Unset,null, orfalsekeeps today's behavior (OS trust store).true, the client calls the CRT method above while building itsTlsContextOptions. The properties are read once, atbuild(). The same trust store is used for the TLS connection to an HTTPS proxy. WhenTRUST_ALL_CERTIFICATESis enabled, the trust store is not read.javax.net.ssl.trustStoreis unset or empty, the OS trust store is used.build()throwsIllegalStateExceptionwith the CRT exception as the cause, instead of falling back to another trust store. This covers a missing file, wrong password, corrupt file, unavailable type or provider,NONE, a store with no certificates or more than 1024 certificates, and a native TLS context failure.awscrt.versionto 0.49.0, the first release with Add a way to init context from jks awslabs/aws-crt-java#1017.bcpkix-jdk18on,bcprov-jdk18on) versions are now root-pom properties, used byaws-crt-clienttests to generate certificates at test time and by the existinghttp-client-testsandprotocol-testsdeclarations.Testing
CrtTrustStoreSystemPropertiesTestSuite, run for both the sync and async clients (20 cases each). The tests perform real TLS handshakes against a local HTTPS server whose self-signed certificate is not in the OS trust store, and cover:trustStoreTypeproperty;build()failure mode;build();build()fails.aws-crt-client: BUILD SUCCESS, 376 tests, 0 failures, with the default macOS TLS backend.AWS_CRT_USE_NON_FIPS_TLS_13=1): 40 tests, 0 failures.crt-core(23 tests),s3(1860 tests), ands3-transfer-manager(527 tests): all pass with 0 failures. Their Reactive Streams TCK suites have only the skips that are expected for optional rules.SSLHandshakeExceptionor the acquisition-timeout error.Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License