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

*: remove TLS1.0, TLS1.1 support #50348

Merged
merged 1 commit into from
Jan 15, 2024
Merged

*: remove TLS1.0, TLS1.1 support #50348

merged 1 commit into from
Jan 15, 2024

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Jan 12, 2024

What problem does this PR solve?

Issue Number: ref #36036

Problem Summary:

What changed and how does it work?

TLS1.0/1.1 has security issues, remove the support of them.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Generate the certificates according to this page https://docs.pingcap.com/tidb/stable/generate-self-signed-certificates
Modify pkg/config/config.toml.example

ssl-ca = "/home/genius/root.crt"
ssl-cert = "/home/genius/tikv.crt"
ssl-key = "/home/genius/tikv.key"

Run tidb-server:

./bin/tidb-server -config config.toml.example

Verify connection with mysql client:

$ mysql --tls-version=TLSv1.0 -v -v -v --ssl-ca='/home/genius/root.crt'  --ssl-cert="/home/genius/tikv.crt" --ssl-key="/home/genius/tikv.key" -uroot -h127.0.0.1  
ERROR 2026 (HY000): SSL connection error: TLS version is invalid

$ mysql --tls-version=TLSv1.1 -v -v -v --ssl-ca='/home/genius/root.crt'  --ssl-cert="/home/genius/tikv.crt" --ssl-key="/home/genius/tikv.key" -uroot -h127.0.0.1  
ERROR 2026 (HY000): SSL connection error: TLS version is invalid
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

remove TLS1.0, TLS1.1 support

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed do-not-merge/needs-linked-issue size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 12, 2024
@tiancaiamao tiancaiamao requested a review from bb7133 January 12, 2024 03:53
@ti-chi-bot ti-chi-bot bot added the component/dumpling This is related to Dumpling of TiDB. label Jan 12, 2024
Copy link

tiprow bot commented Jan 12, 2024

Hi @tiancaiamao. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -187,7 +187,7 @@ func (d *DBStore) adjust(
if d.Security.TLSConfig == nil {
/* #nosec G402 */
d.Security.TLSConfig = &tls.Config{
MinVersion: tls.VersionTLS10,
MinVersion: tls.VersionTLS12,
Copy link
Contributor

Choose a reason for hiding this comment

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

dumpling and lightning may connect to older version of TiDB and MySQL, and their TLS version is older than v1.2. Should we support this case @Frank945946

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TLSv1.2 is introduced in year 2008, 15 years ago, that's old enough.
And as long as those software support TLSv1.2 above, change this MinVersion will not cause any trouble.
Without doubt, that's the case for TiDB.

And then I check the release history of MySQL ...

Release	General availability	Latest release
5.5 LTS	3 December 2010	2018-10-22
5.6 LTS	5 February 2013	2021-01-20
5.7 LTS	21 October 2015	2023-10-25
8.0 LTS	19 April 2018	2023-10-25

I'm sure it's pretty safe to do this change according to the above information.

Copy link
Member

Choose a reason for hiding this comment

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

It is not so 'safe' actually. We do know many TiDB users still using old clients. However, it is reasonable to remove the support of 'TLS 1.0/1.1'.

Thanks @lance6716

Copy link

@Frank945946 Frank945946 Jan 15, 2024

Choose a reason for hiding this comment

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

Removing the support of 'TLS 1.0/1.1' LTGM and please leave a note to the corresponding docs then @lance6716 .

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Merging #50348 (669b625) into master (695d162) will decrease coverage by 16.3559%.
Report is 23 commits behind head on master.
The diff coverage is 50.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50348         +/-   ##
=================================================
- Coverage   71.8223%   55.4665%   -16.3559%     
=================================================
  Files          1444       1555        +111     
  Lines        346984     587587     +240603     
=================================================
+ Hits         249212     325914      +76702     
- Misses        77425     238950     +161525     
- Partials      20347      22723       +2376     
Flag Coverage Δ
integration 36.7226% <0.0000%> (?)
unit 69.9951% <50.0000%> (-1.8273%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 54.0269% <100.0000%> (-2.2860%) ⬇️
parser ∅ <ø> (∅)
br 55.5409% <100.0000%> (+4.2400%) ⬆️

@tiancaiamao tiancaiamao added the security Everything related with security label Jan 12, 2024
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 12, 2024
@bb7133 bb7133 added the compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. label Jan 12, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 12, 2024
Copy link

ti-chi-bot bot commented Jan 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-12 08:07:18.175392682 +0000 UTC m=+603427.759646364: ☑️ agreed by bb7133.
  • 2024-01-12 15:17:07.880735451 +0000 UTC m=+629217.464989138: ☑️ agreed by hawkingrei.

@@ -187,7 +187,7 @@ func (d *DBStore) adjust(
if d.Security.TLSConfig == nil {
/* #nosec G402 */
d.Security.TLSConfig = &tls.Config{
MinVersion: tls.VersionTLS10,
MinVersion: tls.VersionTLS12,
Copy link

@Frank945946 Frank945946 Jan 15, 2024

Choose a reason for hiding this comment

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

Removing the support of 'TLS 1.0/1.1' LTGM and please leave a note to the corresponding docs then @lance6716 .

Copy link

ti-chi-bot bot commented Jan 15, 2024

@Frank945946: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

ti-chi-bot bot commented Jan 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, Frank945946, hawkingrei, lance6716, okJiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jan 15, 2024
@ti-chi-bot ti-chi-bot bot merged commit 715fc0b into pingcap:master Jan 15, 2024
45 of 57 checks passed
bb7133 pushed a commit to bb7133/tidb that referenced this pull request Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. component/dumpling This is related to Dumpling of TiDB. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. security Everything related with security size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants