dotnet / dotnet/runtime

[.NET Core/Linux] X509 chain revocation check uses only first CDP URL, does not fall back to others

Open
#121,253 2 comments 1 reaction 0 assignees View on GitHub
area-System.Security os-linux
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

### Description

On Linux, .NET’s certificate validation (OpenSSL-based) appears to use only the first CRL Distribution Point (CDP) in the certificate. If that URL is unreachable/down, the entire revocation check fails, even when additional CDP endpoints are present on the certificate. This causes unnecessary hard failures and reduces resiliency.

### Reproduction Steps

Use a certificate that has multiple CRL Distribution Points (CDP A – primary, CDP B – secondary).

Make CDP A unreachable (simulate network block or HTTP 5xx).

Build an X509Chain in .NET on Linux with revocation enabled:

```c#
var chain = new X509Chain
{
ChainPolicy =
{
RevocationMode = X509RevocationMode.Online,
RevocationFlag = X509RevocationFlag.EntireChain
}
};
var ok = chain.Build(cert);
```

Observe that the chain build fails due to CRL download failure, even though CDP B is present.

### Expected behavior

Iterate over all CDP URLs in the order provided on the certificate.

Stop at the first successful fetch/valid CRL.

Maintain a short-lived cache of failed CDP endpoints (e.g. static dictionary with TTL) to avoid repeatedly calling an endpoint that is currently down.

### Actual behavior

Only the first CDP endpoint is called.

If it fails, revocation check fails even though alternative CDPs are available.

### Regression?

No

### Known Workarounds

None

### Configuration

.NET (Core) on Linux
Using default OpenSSL-backed chain engine

### Other information

**Why this matters:**
In environments where a primary CRL endpoint is fronted by a CDN or may be temporarily unavailable, the current behavior turns a transient CDP issue into a hard revocation failure for all .NET Core/Linux workloads.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.