Skip to content
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

Add new settings to specify TLS versions to use #9667

Merged
merged 2 commits into from
May 10, 2023

Conversation

maskit
Copy link
Member

@maskit maskit commented May 2, 2023

I found an incompatibility between OpenSSL and BoringSSL.

If valid_tls_versions_in has [TLSv1, TLSv1_2, TLSv1_3] (note that TLSv1_1 isn't in the list), BoringSSL only allows TLSv1 where OpenSSL allows all the three versions. It sounds like a bug but it's actually not.

https://boringssl.googlesource.com/boringssl/+/86ada1ea2f51ff41baa2919337e5d721bd27f764/ssl/ssl_versions.cc#225

// If there is a disabled version after the first enabled one, all versions
// after it are implicitly disabled.

And I also found that the way (API) we currently use to specify available TLS versions is deprecated.

The old way allow us to specify versions individually (like above), but the new way only allows us to specify a range of versions.

Old:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_set_options.html
https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#SSL_OP_NO_TLSv1

New:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_set_min_proto_version.html
https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#SSL_set_min_proto_version

Since the old way is no longer supported by SSL libraries, we should deprecate the current way and only allow ATS users to specify a range.


This adds these new settings:

records.yaml:
  proxy.config.ssl.server.version.min
  proxy.config.ssl.server.version.max
  proxy.config.ssl.client.version.min
  proxy.config.ssl.client.version.max
sni.yaml:
  valid_tls_version_min_in
  valid_tls_version_max_in

and deprecates these settings:

records.yaml:
  proxy.config.ssl.TLSv1
  proxy.config.ssl.TLSv1_1
  proxy.config.ssl.TLSv1_2
  proxy.config.ssl.TLSv1_3
  proxy.config.ssl.client.TLSv1
  proxy.config.ssl.client.TLSv1_1
  proxy.config.ssl.client.TLSv1_2
  proxy.config.ssl.client.TLSv1_3
sni.yaml:
  valid_tls_versions_in

This adds these new settings:
records.yaml:
  proxy.config.ssl.server.version.min
  proxy.config.ssl.server.version.max
  proxy.config.ssl.client.version.min
  proxy.config.ssl.client.version.max
sni.yaml:
  valid_tls_version_min_in
  valid_tls_version_max_in

and deprecates these settings:
records.yaml:
  proxy.config.ssl.TLSv1
  proxy.config.ssl.TLSv1_1
  proxy.config.ssl.TLSv1_2
  proxy.config.ssl.TLSv1_3
  proxy.config.ssl.client.TLSv1
  proxy.config.ssl.client.TLSv1_1
  proxy.config.ssl.client.TLSv1_2
  proxy.config.ssl.client.TLSv1_3
sni.yaml:
  valid_tls_versions_in
@maskit maskit added the TLS label May 2, 2023
@maskit maskit added this to the 10.0.0 milestone May 2, 2023
@maskit maskit self-assigned this May 2, 2023
.. ts:cv:: CONFIG proxy.config.ssl.TLSv1 INT 0
:deprecated:

This setting is depreated in favor of :ts:cv:`proxy.config.ssl.server.version.min` and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: deprecated
there are more probably from the copy/paste

if (!option) {
ssl_client_ctx_options |= SSL_OP_NO_TLSv1;
} else {
// This is disabled by default. It it's used if it's enabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: It it's

@maskit
Copy link
Member Author

maskit commented May 2, 2023

[approve ci]

@bryancall bryancall requested a review from ywkaras May 8, 2023 22:23
auto ssl_vc = dynamic_cast<SSLNetVConnection *>(snis);
ssl_vc->set_valid_tls_version_min(this->min_ver);
ssl_vc->set_valid_tls_version_max(this->max_ver);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not } else if (!unset) { ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I wanted to make it clear that if (!unset) { is the first line for the case min/max isn't used. It enables us to add some code before the if easily.

@maskit maskit merged commit 29d8737 into apache:master May 10, 2023
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jun 3, 2024
* asf/master: (33 commits)
  Add error log for invalid OCSP response (apache#9674)
  Add new settings to specify TLS versions to use (apache#9667)
  Remove flask from tests/Pipfile (apache#9688)
  Doc: Add example of --enable-lto build option with LLVM (apache#9654)
  Added Zhengxi to the asf contributors (apache#9685)
  Don't build native QUIC implementation (apache#9670)
  Stabilize autest tls_hooks17 (apache#9671)
  Cleanup: remove ts::buffer from HostDB. (apache#9677)
  Fix leak in MultiTextMod in ControlBase. (apache#9675)
  Cleanup: remove TsBuffer.h from MIME.cc (apache#9661)
  Cleanup: remove ts::Buffer from ControlBase. (apache#9664)
  setup pre-commit hook at cmake generation time (apache#9669)
  Updated parent retry attempt logic (apache#9620)
  Try to do less work in hot function HttpHookState::getNext (apache#9660)
  cmake build, fixed warning using older openssl APIs (apache#9648)
  rename attempts to retry_attempts (apache#9655)
  OCSP: Fix unitialized variable error. (apache#9662)
  Add support for CONNECT method on HTTP/2 connection (apache#9616)
  Remove deprecated debug output functions from 10 source files. (apache#9657)
  Remove deprecated debug output functions from 14 source files. (apache#9658)
  ...
@bryancall bryancall mentioned this pull request Aug 14, 2024
91 tasks
maskit added a commit to maskit/trafficserver that referenced this pull request Aug 16, 2024
maskit added a commit that referenced this pull request Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants