-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Use certificate thumbprints from entire chain in SSL_CTX cache #112858
base: main
Are you sure you want to change the base?
Conversation
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
@@ -36,33 +36,62 @@ private sealed class SafeSslContextCache : SafeHandleCache<SslContextCacheKey, S | |||
internal readonly struct SslContextCacheKey : IEquatable<SslContextCacheKey> | |||
{ | |||
public readonly bool IsClient; | |||
public readonly byte[]? CertificateThumbprint; | |||
public readonly List<byte[]> CertificateThumbprints; |
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.
The CertificateThumbprints field is declared as a public readonly List, but the list itself remains mutable. This can lead to unexpected behavior when this key is used in caching or dictionary operations, so consider exposing an immutable collection or making a defensive copy in the constructor.
public readonly List<byte[]> CertificateThumbprints; | |
public readonly ReadOnlyCollection<byte[]> CertificateThumbprints; |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
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.
it seems like simple array would be sufficient as we know the count upfront...
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.
LGTM.
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Nice branch name 😅😅 |
Fixes #112856.
Update the SSL context cache to utilize certificate thumbprints from the entire certificate chain. This mimics what we do for MsQuic
runtime/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicConfiguration.Cache.cs
Line 47 in aeda1de