Skip to content

Commit 1c18f54

Browse files
authored
Add breaking change documentation for SSL certificate revocation check mode change in .NET 10 (#46928)
1 parent a189f83 commit 1c18f54

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
6767

6868
| Title | Type of change | Introduced version |
6969
|-------|-------------------|--------------------|
70+
| [HttpClient/SslStream default certificate revocation check mode changed to Online](networking/10.0/ssl-certificate-revocation-check-default.md) | Behavioral change | Preview 6 |
7071
| [Streaming HTTP responses enabled by default in browser HTTP clients](networking/10.0/default-http-streaming.md) | Behavioral change | Preview 3 |
7172

7273
## SDK and MSBuild
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: "Breaking change - HttpClient/SslStream default certificate revocation check mode changed to Online"
3+
description: "Learn about the breaking change in .NET 10 where the default certificate revocation check mode changed from 'NoCheck' to 'Online'."
4+
ms.date: 06/23/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/46824
7+
---
8+
9+
# HttpClient/SslStream default certificate revocation check mode changed to `Online`
10+
11+
The default values of <xref:System.Net.Security.SslClientAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> and <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> have changed from `NoCheck` to `Online`. This change enhances security and makes the behavior consistent with <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy?displayProperty=nameWithType>.
12+
13+
## Version introduced
14+
15+
.NET 10 Preview 6
16+
17+
## Previous behavior
18+
19+
Previously, the default values of <xref:System.Net.Security.SslClientAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> and <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> were <xref:System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck?displayProperty=nameWithType>, meaning revocation status of peer certificates wasn't checked by default.
20+
21+
## New behavior
22+
23+
Starting in .NET 10, the default values of <xref:System.Net.Security.SslClientAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> and <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> are <xref:System.Security.Cryptography.X509Certificates.X509RevocationMode.Online?displayProperty=nameWithType>, meaning revocation status of peer certificates are checked online by default.
24+
25+
## Type of breaking change
26+
27+
This change is a [behavioral change](../../categories.md#behavioral-change).
28+
29+
## Reason for change
30+
31+
This change enhances security and ensures consistency between APIs related to X.509 certificate revocation checking.
32+
33+
## Recommended action
34+
35+
If certificate revocation checking is not desired, specify <xref:System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck?displayProperty=nameWithType> explicitly:
36+
37+
```csharp
38+
var clientOptions = new SslClientAuthenticationOptions
39+
{
40+
TargetHost = "example.com",
41+
CertificateRevocationCheckMode = X509RevocationMode.NoCheck
42+
};
43+
44+
var serverOptions = new SslServerAuthenticationOptions
45+
{
46+
ServerCertificate = serverCertificate,
47+
CertificateRevocationCheckMode = X509RevocationMode.NoCheck
48+
};
49+
```
50+
51+
> [!NOTE]
52+
> Due to a bug on the OSX platform, you might encounter certificate validation failures with <xref:System.Security.Cryptography.X509Certificates.X509ChainStatusFlags.RevocationStatusUnknown?displayProperty=nameWithType> in scenarios where the certificate doesn't support revocation checking via OCSP. This is a bug in the underlying platform crypto implementation. To avoid failing the certificate validation if revocation status can't be retrieved, either disable certificate revocation checking as per the previous instructions, or set <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy> with <xref:System.Security.Cryptography.X509Certificates.X509ChainPolicy.VerificationFlags?displayProperty=nameWithType> set to `X509VerificationFlags.IgnoreEndRevocationUnknown | X509VerificationFlags.IgnoreCertificateAuthorityRevocationUnknown`.
53+
54+
In situations where you can't modify the code, you can restore the previous behavior with one of the following settings:
55+
56+
- Set `System.Net.Security.NoRevocationCheckByDefault` AppContext switch to `true`.
57+
- Set `DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT` environment variable to `true`.
58+
59+
## Affected APIs
60+
61+
- <xref:System.Net.Security.SslStream.AuthenticateAsClient%2A?displayProperty=fullName>
62+
- <xref:System.Net.Security.SslStream.AuthenticateAsClientAsync%2A?displayProperty=fullName>
63+
- <xref:System.Net.Security.SslStream.AuthenticateAsServer%2A?displayProperty=fullName>
64+
- <xref:System.Net.Security.SslStream.AuthenticateAsServerAsync%2A?displayProperty=fullName>
65+
- <xref:System.Net.Http.HttpClient.Send*?displayProperty=fullName> (when using either <xref:System.Net.Http.WinHttpHandler> or <xref:System.Net.Http.SocketsHttpHandler>)
66+
- <xref:System.Net.Http.HttpClient.SendAsync*?displayProperty=fullName> (when using either <xref:System.Net.Http.WinHttpHandler> or <xref:System.Net.Http.SocketsHttpHandler>)

docs/core/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ items:
6060
href: interop/10.0/search-assembly-directory.md
6161
- name: Networking
6262
items:
63+
- name: HttpClient/SslStream default certificate revocation check mode changed to Online
64+
href: networking/10.0/ssl-certificate-revocation-check-default.md
6365
- name: Streaming HTTP responses enabled by default in browser HTTP clients
6466
href: networking/10.0/default-http-streaming.md
6567
- name: SDK and MSBuild

0 commit comments

Comments
 (0)