[Apache HTTP Client] Stop auto-enabling TLS protocol versions #2934
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
Since 2014, in the Java SDK v1, the SDK's Apache HTTP Client has auto-enabled certain TLS protocol versions if they are supported by the local system. The versions auto-enabled are:
TLSv1.2
,TLSv1.1
,TLSv1
, andTLS
. The original motivation was to always try to use the latest and most secure version. This made sense at the time, especially when both Java 6 and Java 7 defaulted to onlyTLSv1.0
. It wasn't until Java 8 that the default becameTLSv1.2
. So there was some apparent value in the SDK nudging clients towards the latest version that they may otherwise be slow to adopt.sources: [1] [2]
Fast-forward 7+ years and most JVM vendors now enable newer TLS versions (
TLSv1.3
) by default and many of the above versions are now considered older and less secure, yet the SDK continues to auto-enable them. Furthermore, the Java SDK v2 requires Java 8 or higher, which has an implicit guarantee of defaulting toTLSv1.2
or higher, meaning these SDK-enabled versions are never newer than default version.While the TLS negotiation will resolve to the highest mutually supported version, some users may still wish to explicitly disable older versions as an extra precaution. The recommended and conventional way to do this is via the
jdk.tls.client.protocols
system property, but the SDK's implementation will continue to append its own list of enabled versions to the user's declared list. The only way for users to ensure they disable those versions is via thejdk.tls.disabledAlgorithms
system property.https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/security-java-tls.html
https://java.com/en/configure_crypto.html
Since the SDK's list of preferred TLS versions is no longer up to date, and any new preferences would be similarly subject to becoming stale in the future, the SDK should stop trying to offer opinions on the preferred TLS version to use and instead allow the JVM defaults and user-declared properties to fully control this behavior.
Modifications
Stop appending TLS versions to the list of enabled protocol versions.
License