Skip to content

Commit d5e7963

Browse files
Copilotgewarren
andcommitted
Add breaking change documentation for SSL certificate revocation check mode change
Co-authored-by: gewarren <[email protected]>
1 parent afa0936 commit d5e7963

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

docs/core/compatibility/10.0.md

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

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

7071
## SDK and MSBuild
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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 Preview 6 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+
<xref:System.Net.Security.SslClientAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> and <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> default values 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+
<xref:System.Net.Security.SslClientAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> and <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> default values were `NoCheck`, meaning certificate revocation lists weren't checked by default.
20+
21+
```csharp
22+
var clientOptions = new SslClientAuthenticationOptions
23+
{
24+
TargetHost = "example.com"
25+
// CertificateRevocationCheckMode defaults to NoCheck
26+
};
27+
28+
var serverOptions = new SslServerAuthenticationOptions
29+
{
30+
ServerCertificate = serverCertificate
31+
// CertificateRevocationCheckMode defaults to NoCheck
32+
};
33+
```
34+
35+
## New behavior
36+
37+
<xref:System.Net.Security.SslClientAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> and <xref:System.Net.Security.SslServerAuthenticationOptions.CertificateRevocationCheckMode?displayProperty=nameWithType> default values are `Online`, meaning certificate revocation lists are checked online by default.
38+
39+
```csharp
40+
var clientOptions = new SslClientAuthenticationOptions
41+
{
42+
TargetHost = "example.com"
43+
// CertificateRevocationCheckMode defaults to Online
44+
};
45+
46+
var serverOptions = new SslServerAuthenticationOptions
47+
{
48+
ServerCertificate = serverCertificate
49+
// CertificateRevocationCheckMode defaults to Online
50+
};
51+
```
52+
53+
## Type of breaking change
54+
55+
This is a [behavioral change](../../categories.md#behavioral-change).
56+
57+
## Reason for change
58+
59+
This change enhances security and ensures consistency between APIs related to X.509 certificate revocation checking.
60+
61+
## Recommended action
62+
63+
If certificate revocation checking is not desired, specify `X509RevocationMode.NoCheck` explicitly:
64+
65+
```csharp
66+
var clientOptions = new SslClientAuthenticationOptions
67+
{
68+
TargetHost = "example.com",
69+
CertificateRevocationCheckMode = X509RevocationMode.NoCheck
70+
};
71+
72+
var serverOptions = new SslServerAuthenticationOptions
73+
{
74+
ServerCertificate = serverCertificate,
75+
CertificateRevocationCheckMode = X509RevocationMode.NoCheck
76+
};
77+
```
78+
79+
In situations where the code might not be modified, previous behavior can be enabled by setting either:
80+
81+
- `System.Net.Security.NoRevocationCheckByDefault` AppContext switch to `true`
82+
- `DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT` environment variable to `true`
83+
84+
## Affected APIs
85+
86+
- <xref:System.Net.Security.SslStream.AuthenticateAsClient%2A?displayProperty=fullName>
87+
- <xref:System.Net.Security.SslStream.AuthenticateAsClientAsync%2A?displayProperty=fullName>
88+
- <xref:System.Net.Security.SslStream.AuthenticateAsServer%2A?displayProperty=fullName>
89+
- <xref:System.Net.Security.SslStream.AuthenticateAsServerAsync%2A?displayProperty=fullName>
90+
- <xref:System.Net.Http.HttpClient?displayProperty=fullName>

docs/core/compatibility/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ items:
5656
href: interop/10.0/search-assembly-directory.md
5757
- name: Networking
5858
items:
59+
- name: HttpClient/SslStream default certificate revocation check mode changed to Online
60+
href: networking/10.0/ssl-certificate-revocation-check-default.md
5961
- name: Streaming HTTP responses enabled by default in browser HTTP clients
6062
href: networking/10.0/default-http-streaming.md
6163
- name: SDK and MSBuild
@@ -1910,6 +1912,8 @@ items:
19101912
items:
19111913
- name: .NET 10
19121914
items:
1915+
- name: HttpClient/SslStream default certificate revocation check mode changed to Online
1916+
href: networking/10.0/ssl-certificate-revocation-check-default.md
19131917
- name: Streaming HTTP responses enabled by default in browser HTTP clients
19141918
href: networking/10.0/default-http-streaming.md
19151919
- name: .NET 9

0 commit comments

Comments
 (0)