-
Notifications
You must be signed in to change notification settings - Fork 6.1k
docs: Breaking change – SslStream server-side AIA certificate downloads disabled by default (.NET 11) #52853
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
Open
Copilot
wants to merge
4
commits into
main
Choose a base branch
from
copilot/disable-aia-certificate-downloads
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0d14255
Initial plan
Copilot 0235f10
Add breaking change article for SslStream AIA certificate downloads d…
Copilot 80bffe6
Apply suggestions from code review
gewarren e6606dc
Update docs/core/compatibility/networking/11/sslstream-aia-downloads-…
gewarren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
docs/core/compatibility/networking/11/sslstream-aia-downloads-disabled.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: "Breaking change: SslStream server-side AIA certificate downloads disabled by default" | ||
| description: "Learn about the breaking change in .NET 11 where SslStream disables AIA certificate downloads during server-side client-certificate validation by default." | ||
| ms.date: 04/03/2026 | ||
| ai-usage: ai-assisted | ||
| --- | ||
|
|
||
| # SslStream server-side AIA certificate downloads disabled by default | ||
|
|
||
| Starting in .NET 11, <xref:System.Net.Security.SslStream> doesn't download missing intermediate certificates using the Authority Information Access (AIA) extension by default when validating client certificates as a server. | ||
|
|
||
| ## Version introduced | ||
|
|
||
| .NET 11 Preview 3 | ||
|
|
||
| ## Previous behavior | ||
|
|
||
| Previously, when `SslStream` validated client certificates as a server, it attempted to download missing intermediate certificates using the AIA extension if the client didn't provide them during the TLS handshake. This behavior occurred even when no custom <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateChainPolicy> was specified. | ||
|
|
||
| For example, the following code would attempt to download intermediate certificates via AIA if the client omitted them: | ||
|
|
||
| ```csharp | ||
| var sslStream = new SslStream(networkStream); | ||
|
|
||
| await sslStream.AuthenticateAsServerAsync(new SslServerAuthenticationOptions | ||
| { | ||
| ServerCertificate = serverCertificate, | ||
| ClientCertificateRequired = true, | ||
| CertificateRevocationCheckMode = X509RevocationMode.Online | ||
| }); | ||
| ``` | ||
|
|
||
| ## New behavior | ||
|
|
||
| Starting in .NET 11, `SslStream` disables AIA certificate downloads when operating as a server that validates client certificates. If the client doesn't provide all required intermediate certificates during the TLS handshake, the server no longer attempts to download them. The handshake fails with a certificate validation error unless the server is configured with the required intermediate certificates. | ||
|
|
||
| This change only applies when no custom <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateChainPolicy> is provided. If a custom <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy> is specified, its <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy.DisableCertificateDownloads> value is respected. | ||
|
|
||
| ## Type of breaking change | ||
|
|
||
| This change is a [behavioral change](../../categories.md#behavioral-change). | ||
|
|
||
| ## Reason for change | ||
|
|
||
| Allowing AIA downloads during the TLS handshake can cause significant performance degradation if the AIA server is slow or unresponsive. Additionally, making outbound HTTP requests to client-provided endpoints introduces potential security risks, since an attacker could influence which external endpoints the server contacts. For more details, see the [pull request](https://github.com/dotnet/runtime/pull/125049) that introduced this change. | ||
|
|
||
| ## Recommended action | ||
|
|
||
| Choose one of the following options: | ||
|
|
||
| - **Ensure the client sends all required intermediate certificates**: Configure the client to include all intermediate certificates in the TLS handshake. On the client side, use <xref:System.Net.Security.SslClientAuthenticationOptions.ClientCertificateContext> with an <xref:System.Net.Security.SslStreamCertificateContext> that includes the full chain. For most scenarios, creating `SslStreamCertificateContext` handles intermediate certificate management automatically. | ||
|
|
||
| - **Provide intermediate certificates in the server's chain policy**: Use <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy.ExtraStore> to supply the necessary intermediate certificates to the server: | ||
|
|
||
| ```csharp | ||
| var chainPolicy = new X509ChainPolicy | ||
| { | ||
| // Disable AIA downloads (the default in .NET 11) | ||
| DisableCertificateDownloads = true, | ||
|
|
||
| // Add any necessary intermediate certificates | ||
| ExtraStore = { intermediateCertificate }, | ||
|
|
||
| // If client certificates are issued by a private root CA, specify custom trust | ||
| TrustMode = X509ChainTrustMode.CustomTrustRoot, | ||
gewarren marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CustomTrustStore = { rootCertificate } | ||
| }; | ||
|
|
||
| var sslStream = new SslStream(networkStream); | ||
|
|
||
| await sslStream.AuthenticateAsServerAsync(new SslServerAuthenticationOptions | ||
| { | ||
| ServerCertificateContext = serverCertificateContext, | ||
| ClientCertificateRequired = true, | ||
| CertificateChainPolicy = chainPolicy | ||
| }); | ||
| ``` | ||
|
|
||
| - **Explicitly allow AIA downloads (not recommended)**: Restore the previous behavior by setting <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy.DisableCertificateDownloads> to `false`. This approach is not recommended due to the associated performance and security risks. | ||
|
|
||
| ## Affected APIs | ||
|
|
||
| - <xref:System.Net.Security.SslStream.AuthenticateAsServer*?displayProperty=fullName> | ||
| - <xref:System.Net.Security.SslStream.AuthenticateAsServerAsync*?displayProperty=fullName> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 comment makes it sound like
trueis the default value forX509ChainPolicy.DisableCertificateDownloads, which is not the case. It is only when explicitX509ChainPolicywasn't passed by the caller thatSslStreamwill setDisableCertifiaiteDownloads = trueon the one created internally when authenticating as a server.