Add ServerName configuration option for certificate name check and SNI#106
Merged
fmauchle merged 4 commits intoradsecproxy:masterfrom Jan 27, 2023
Merged
Conversation
0d8d191 to
85b7028
Compare
fmauchle
added a commit
that referenced
this pull request
Jan 27, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds the configuration option
ServerNamein theclientandserversectionsThe option has the following behavior:
ServerNameinstead ofHostServerNameis used, unless the more specificSNIservernameis set.Especially the first behavior is extremely useful in settings where IP addresses are used in the
Hostoption to avoid blocking startup due to DNS issues.With the current setting it is necessary to disable the CertificateNameCheck and provide an own MatchCertificateAttribute with a Regex.
This PR helps with the definition since it does not need to deal with regex and automatically uses both SAN and CN for the check.
(Example for dealing with regex:
/^tld1.example\.com$/is also valid for a cert fortld1-example.comdue to the unescaped first dot. And those config errors are hard to spot)I have not done excessive testing of edge cases in the certificate validation yet, hence the WIP-status, but basic test cases work.Update: I have now rebased to the current master, checked the code again and haven't found any issues, so I would say that this PR is ready now.
Feedback welcome.