Skip to content

[Apache HTTP Client] Stop auto-enabling TLS protocol versions #2934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2021

Conversation

Bennett-Lynch
Copy link
Contributor

@Bennett-Lynch Bennett-Lynch commented Dec 22, 2021

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, and TLS. 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 only TLSv1.0. It wasn't until Java 8 that the default became TLSv1.2. So there was some apparent value in the SDK nudging clients towards the latest version that they may otherwise be slow to adopt.

Java Version Release Date SSL/TLS Default Other Supported Versions
Java 6 December 2006 TLS 1.0 TLS 1.1 (update 111 and later), SSLv3.0*
Java 7 July 2011 TLS 1.0 TLS 1.2, TLS 1.1, SSLv3.0*
Java 8 March 2014 TLS 1.2 TLS 1.1, TLS 1.0, SSLv3.0*

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 to TLSv1.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 the jdk.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

  • I confirm that this pull request can be released under the Apache 2 license

## 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`, and `TLS`. 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 only `TLSv1.0`. It wasn't until
Java 8 that the default became `TLSv1.2`. So there was some apparent
value in the SDK nudging clients towards the latest version that they
may otherwise be slow to adopt.

Fast-forward 7+ years and most JVM vendors now enable newer TLS versions
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 to `TLSv1.2` or higher, meaning these SDK-enabled versions
are never newer than default version.

While this isn't strictly a security concern (because 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 the `jdk.tls.disabledAlgorithms` system
property.

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 allow the JVM defaults and
user-declared properties to control this behavior.

https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/security-java-tls.html

https://java.com/en/configure_crypto.html

## Modifications

* Stop appending TLS versions to the list of enabled protocol versions.
@Bennett-Lynch Bennett-Lynch requested a review from a team as a code owner December 22, 2021 03:34
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Bennett-Lynch Bennett-Lynch merged commit fe3e14a into aws:master Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants