-
Notifications
You must be signed in to change notification settings - Fork 142
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
Stop using commonName to validate certificates. #238
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good.
@swift-nio-bot test this please |
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.
I think we should do this - anyone that's using functionality which has been deprecated for 20 years should probably invest the time to move on.
/// name fields. For this reason, we currently allow an override for trusting the common name. This | ||
/// is a temporary measure to allow users to work around these limitations, but we will remove this | ||
/// functionality in future. | ||
public var trustCommonName: Bool |
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.
Should we (assuming it's possible) mark the setter for this as deprecated right from the start?
Motivation: CommonName as part of certificate hostname verification has been deprecated for more than two decades. Browsers have finally stopped using the commonName as part of verification, and the WebPKI forbids putting names into the commonName that are not also part of the subjectAlternativeName extension. Continuing to trust the commonName as part of the certificate hostname will put us in a weaker position than most of the browser ecosystem. That's not a good place to be, so we should flip our default to not trusting the commonName any longer. For pragmatic reasons, we do allow an override, but the default configuration is off. Users using this override will likely find themselves disappointed when we remove it at some point in the future. Modifications: - Added TLSConfiguration options to enable trusting commonName fields for hostname verification. - Made investigating the commonName field optional during hostname verification. - Tests to validate the new behaviour. Result: No trusting common names by default anymore.
b027bb4
to
fc028b4
Compare
Motivation:
CommonName as part of certificate hostname verification has been
deprecated for more than two decades. Browsers have finally stopped
using the commonName as part of verification, and the WebPKI forbids
putting names into the commonName that are not also part of the
subjectAlternativeName extension.
Continuing to trust the commonName as part of the certificate hostname
will put us in a weaker position than most of the browser ecosystem.
That's not a good place to be, so we should flip our default to not
trusting the commonName any longer.
For pragmatic reasons, we do allow an override, but the default
configuration is off. Users using this override will likely find
themselves disappointed when we remove it at some point in the future.
Modifications:
for hostname verification.
verification.
Result:
No trusting common names by default anymore.