-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix: Inconsistent certificate chain handling between endpoint and default configuration #60710
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
Fix: Inconsistent certificate chain handling between endpoint and default configuration #60710
Conversation
@dotnet-policy-service agree |
|
FYI changing something like certificate handling this is almost certainly going to need tests to get accepted, particularly as it's a bug fix. |
…e certificate path Fix Formatting
Thanks for your feedback @martincostello ! I've added a test that fails on main but succeeds with this change. |
BrennanConroy
left a comment
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.
Nice find and appreciate the fix as well! Comments are just code cleanup nits.
It looks like it was probably an oversight when the cert chain work was done, don't see any reference as to why we ignored the chain which makes me think it was meant to be temporary and then forgotten about.
src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs
Outdated
Show resolved
Hide resolved
Thanks @BrennanConroy ! That makes sense, happy to help here. I've gone back and resolved those nits, if all looks good please merge when possible. Thank you! |
|
Great work @jnjudge1! |
Fix: Inconsistent certificate chain handling between endpoint and default configuration
Changes Kestrel configuration to process default certificate loading configurations the same as per endpoint configurations. With this change, certificates specified in the default configuration section will have their chains presented on the server even if their intermediates are not present in the system certificate store.
Description
IHttpsConfigurationService.cs:
CertificateChainproperty onto the internalCertificateAndConfigstruct, necessary for passing cert chain fromTlsConfigurationLoadertoKestrelConfigurationLoader.TlsConfigurationLoader.cs:
CertificateAndConfigobject with the chain specified if the chain is not null.KestrelConfigurationLoader.cs:
DefaultCertificateChainproperty for specifying the default certificate chain to load on endpoints inKestrelServerOptions.ApplyDefaultCertificate.KestrelServerOptions.cs:
KestrelConfigurationLoaderand set theServerCertificateChainproperty on thehttpsOptionsfor an endpoint.Fixes #60709