-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: Allow setting a minimum TLS version #26307
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
Conversation
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
There was a problem hiding this 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.
Opened up an issue to keep track of it here |
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
* 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
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
* 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
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

And this one is 1.2
