Skip to content

Comments

Add ServerName configuration option for certificate name check and SNI#106

Merged
fmauchle merged 4 commits intoradsecproxy:masterfrom
Janfred:feature/add_server_name
Jan 27, 2023
Merged

Add ServerName configuration option for certificate name check and SNI#106
fmauchle merged 4 commits intoradsecproxy:masterfrom
Janfred:feature/add_server_name

Conversation

@Janfred
Copy link
Contributor

@Janfred Janfred commented Nov 6, 2022

This PR adds the configuration option ServerName in the client and server sections

The option has the following behavior:

  • If set, the certificate name check will check against the value of ServerName instead of Host
  • For server blocks, if SNI is enabled, the value of ServerName is used, unless the more specific SNIservername is set.

Especially the first behavior is extremely useful in settings where IP addresses are used in the Host option 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 for tld1-example.com due 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.

@Janfred Janfred force-pushed the feature/add_server_name branch from 0d8d191 to 85b7028 Compare January 20, 2023 10:37
@Janfred Janfred changed the title WIP: Add ServerName configuration option for certificate name check and SNI Add ServerName configuration option for certificate name check and SNI Jan 20, 2023
@fmauchle fmauchle self-assigned this Jan 27, 2023
fmauchle added a commit that referenced this pull request Jan 27, 2023
@fmauchle fmauchle merged commit 85b7028 into radsecproxy:master Jan 27, 2023
@Janfred Janfred deleted the feature/add_server_name branch April 11, 2023 10:58
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.

2 participants