feat: add TLS versions configuration #3303
Merged
+49
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Add configuration options for TLSMinVersion and TLSMaxVersion.
This enables configuring specific TLS versions to accept. That allows use-cases such as setting TLS 1.3 as minimum version (disables TLS 1.2), or enforcing TLS 1.2 only (disables TLS 1.3) for easier debugging of secure connections.
Default functionality of Go TLS is to allow TLS 1.2 and TLS 1.3 and have client and server negotiate. (Except in Dex 2.37.0 where TLS 1.0 to TLS 1.3 were always enabled).
serve.go
doesn't have any unit tests, so didn't add any. Unit tests are added forconfig.go
.Special notes for your reviewer
This can be tested with
sslyze
for example:cd examples/k8s; ./gencert.sh
cp config.dev.yaml config.yaml
web:
pip3 install sslyze
(use virtualenv etc as needed)sslyze 127.0.0.1:5554
or useopenssl
if you like