Disable AIA certificate downloads for server client-cert validation by default#125049
Disable AIA certificate downloads for server client-cert validation by default#125049rzikm merged 6 commits intodotnet:mainfrom
Conversation
…y default When SslStream operates as a server validating client certificates and no custom X509ChainPolicy has been provided by the user, set DisableCertificateDownloads to true on the chain policy. This prevents the server from making outbound HTTP requests to download intermediate certificates via AIA extensions. Add compat switch System.Net.Security.EnableServerAIADownloads and environment variable DOTNET_SYSTEM_NET_SECURITY_ENABLESERVERAIADOWNLOADS to opt back into the previous behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates SslStream server-side client-certificate validation to avoid outbound intermediate-certificate downloads (AIA) by default when the user hasn’t provided a custom X509ChainPolicy, with a compat switch/env-var opt-out.
Changes:
- Add
System.Net.Security.EnableServerAIADownloads(AppContext) /DOTNET_SYSTEM_NET_SECURITY_ENABLESERVERAIADOWNLOADS(env var) switch plumbing. - When acting as a server and using the default chain policy, set
chain.ChainPolicy.DisableCertificateDownloads = trueduring remote certificate validation. - Add a functional test validating the default behavior and the AppContext compat switch.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs | Adds compat switch handling and applies DisableCertificateDownloads on server-side default chain policy. |
| src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs | Adds RemoteExecutor-based functional coverage for default behavior and AppContext switch. |
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs
Show resolved
Hide resolved
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs
Outdated
Show resolved
Hide resolved
…disable # Conflicts: # src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs
Show resolved
Hide resolved
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs
Outdated
Show resolved
Hide resolved
…tream.Protocol.cs Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs
Show resolved
Hide resolved
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs
Outdated
Show resolved
Hide resolved
📋 Breaking Change Documentation RequiredCreate a breaking change issue with AI-generated content Generated by Breaking Change Documentation Tool - 2026-03-09 09:15:07 |
During TLS handshake, peers should include all intermediate certificates necessary for the other side to perform certificate validation. If intermediates are not sent, it is possible for the receiver to look them up and download using the Authority Information Access extension (AIA).
This behavior is not desirable on server side for multiple reasons:
This PR changes the default behavior of server SslStream instances to disable intermediate cert downloading using AIA by default. Scenarios, where user passes custom
X509ChainPolicyare not affected.This change may break scenarios where client and/or server is not properly configured, meaning either:
Action to be taken by affected users are either:
X509ChainPolicywithExtraStorethat contains the necessary intermediates. Note that you also should specifyDisableCertificateDownloads = trueon the policy as the default isfalseX509ChainPolicythat allows AIA downloads (DisableCertificateDownloads = false)