Skip to content

Conversation

mgattozzi
Copy link
Contributor

This commit allows users to set a minimum TLS version. The default is 1.2. The choices are TLS 1.2 or TLS 1.3 which can be set via env var:

INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.2"
or
INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.3"

and for the command line flag for the serve command:

--tls-minimum-version tls-1.2

or

--tls-minimum-version tls-1.3

With this users have more fine grained control over what tls version they require.

Closes #26255

Below are some curl commands showing that this works. This one shows that 1.3 is the minimum
Screenshot from 2025-04-22 12-06-44

And this one is 1.2
Screenshot from 2025-04-22 12-07-22

This commit allows users to set a minimum TLS version. The default is
1.2. The choices are TLS 1.2 or TLS 1.3 which can be set via env var:

INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.2"
or
INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.3"

and for the command line flag for the serve command:

--tls-minimum-version tls-1.2

or

--tls-minimum-version tls-1.3

With this users have more fine grained control over what tls version
they require.

Closes #26255
@mgattozzi mgattozzi requested a review from a team April 22, 2025 16:17
Copy link
Contributor

@hiltontj hiltontj left a comment

Choose a reason for hiding this comment

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

The changes look good. I'll approve but some automated tests would be nice (see below)


It looks like you can specify a min/max TLS version for a reqwest::Client. So, you might be able to spin up the server in a CLI test and check using a hand-rolled reqwest client, similar to what you did using curl in the PR description.

@mgattozzi
Copy link
Contributor Author

Opened up an issue to keep track of it here

@mgattozzi mgattozzi merged commit af57abd into main Apr 22, 2025
12 checks passed
@mgattozzi mgattozzi deleted the mgattozzi/tls-min branch April 22, 2025 17:57
mgattozzi added a commit that referenced this pull request Apr 24, 2025
This is a follow on to #26307. In this commit we add a test where we
check that connections only pass if TLS is set to v1.3. The default is
1.2 and other tests connect with that just fine. In this test we spin
up a server using only v1.3 as the minimum and try to connect with v1.2
which we expect to fail and then v1.3 which should pass.

Closes #26308
mgattozzi added a commit that referenced this pull request Apr 24, 2025
* feat: Add a negative cert test

This adds a test that will panic on server startup because connections
to said server are invalid. We add a bad expired cert to our cert
generation for usage in our tests.

Note that this test is only really valid if other tests pass as it
depends on waiting for the server start checks to fail. If other
tests run then their server started fine and so did this one, the
only difference being that connections will error due to a bad tls cert.

Closes #26256

* feat: Add minimum TLS version test

This is a follow on to #26307. In this commit we add a test where we
check that connections only pass if TLS is set to v1.3. The default is
1.2 and other tests connect with that just fine. In this test we spin
up a server using only v1.3 as the minimum and try to connect with v1.2
which we expect to fail and then v1.3 which should pass.

Closes #26308
hiltontj pushed a commit that referenced this pull request May 2, 2025
This commit allows users to set a minimum TLS version. The default is
1.2. The choices are TLS 1.2 or TLS 1.3 which can be set via env var:

INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.2"
or
INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.3"

and for the command line flag for the serve command:

--tls-minimum-version tls-1.2

or

--tls-minimum-version tls-1.3

With this users have more fine grained control over what tls version
they require.

Closes #26255
hiltontj pushed a commit that referenced this pull request May 2, 2025
* feat: Add a negative cert test

This adds a test that will panic on server startup because connections
to said server are invalid. We add a bad expired cert to our cert
generation for usage in our tests.

Note that this test is only really valid if other tests pass as it
depends on waiting for the server start checks to fail. If other
tests run then their server started fine and so did this one, the
only difference being that connections will error due to a bad tls cert.

Closes #26256

* feat: Add minimum TLS version test

This is a follow on to #26307. In this commit we add a test where we
check that connections only pass if TLS is set to v1.3. The default is
1.2 and other tests connect with that just fine. In this test we spin
up a server using only v1.3 as the minimum and try to connect with v1.2
which we expect to fail and then v1.3 which should pass.

Closes #26308
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.

[TLS, V3] Allow forcing of TLS 1.3
2 participants