Soenneker.Cloudflare.Validators.Request
4.0.399
Prefix Reserved
dotnet add package Soenneker.Cloudflare.Validators.Request --version 4.0.399
NuGet\Install-Package Soenneker.Cloudflare.Validators.Request -Version 4.0.399
<PackageReference Include="Soenneker.Cloudflare.Validators.Request" Version="4.0.399" />
<PackageVersion Include="Soenneker.Cloudflare.Validators.Request" Version="4.0.399" />
<PackageReference Include="Soenneker.Cloudflare.Validators.Request" />
paket add Soenneker.Cloudflare.Validators.Request --version 4.0.399
#r "nuget: Soenneker.Cloudflare.Validators.Request, 4.0.399"
#:package Soenneker.Cloudflare.Validators.Request@4.0.399
#addin nuget:?package=Soenneker.Cloudflare.Validators.Request&version=4.0.399
#tool nuget:?package=Soenneker.Cloudflare.Validators.Request&version=4.0.399
Soenneker.Cloudflare.Validators.Request
Validates an ASP.NET Core request's TLS client certificate against Cloudflare's Authenticated Origin Pull CA.
Installation
dotnet add package Soenneker.Cloudflare.Validators.Request
Registration
using Soenneker.Cloudflare.Validators.Request.Registrars;
services.AddCloudflareRequestValidatorAsSingleton();
The package supplies the Cloudflare Authenticated Origin Pull CA certificate as a build resource. Set Cloudflare:RequestValidatorLog to true only when debug logging for missing or invalid certificates is useful.
Usage
using Soenneker.Cloudflare.Validators.Request.Abstract;
bool fromCloudflare = await validator.IsFromCloudflare(
httpContext,
httpContext.RequestAborted);
if (!fromCloudflare)
{
httpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
return;
}
IsFromCloudflare requires a client certificate on HttpContext.Connection.ClientCertificate. It builds a custom-trust chain to the packaged Cloudflare CA, requires the client-authentication extended key usage, disables certificate downloads, and performs normal certificate validity checks.
Required origin setup
This validator is meaningful only when all of the following are true:
- Authenticated Origin Pulls is enabled for the Cloudflare zone.
- The public origin accepts traffic only through Cloudflare or otherwise requires a valid client certificate.
- The TLS endpoint serving ASP.NET Core requests requests and forwards the actual client certificate.
If TLS terminates at a load balancer or reverse proxy, configure certificate forwarding only across a trusted internal boundary. A public request header is not proof of a client certificate and must not be copied into ClientCertificate without authenticating the proxy that supplied it.
Validate(string) is a lower-level fingerprint comparison. It compares the supplied hexadecimal SHA-256 value with the packaged CA certificate; it does not validate a request or leaf certificate chain.
This package verifies Cloudflare's shared Authenticated Origin Pull CA, not a zone-specific origin-pull certificate. For enforcement in MVC applications, Soenneker.Cloudflare.Attributes.Require provides an authorization filter built on this validator.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Cloudflare.OriginCerts.Thumbprints (>= 4.0.41)
- Soenneker.Extensions.ValueTask (>= 4.0.123)
- Soenneker.Utils.File (>= 4.0.2280)
- Soenneker.Utils.Paths.Resources (>= 4.0.263)
- Soenneker.Validators.Validator (>= 4.0.741)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Cloudflare.Validators.Request:
| Package | Downloads |
|---|---|
|
Soenneker.Cloudflare.Attributes.Require
A .NET authorization filter for requiring Cloudflare sourced traffic |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.399 | 0 | 9/24/2026 |
| 4.0.398 | 0 | 9/24/2026 |
| 4.0.397 | 180 | 9/16/2026 |
| 4.0.396 | 94 | 9/16/2026 |
| 4.0.395 | 90 | 9/16/2026 |
| 4.0.394 | 109 | 9/16/2026 |
| 4.0.393 | 162 | 9/15/2026 |
| 4.0.392 | 94 | 9/15/2026 |
| 4.0.391 | 246 | 9/14/2026 |
| 4.0.390 | 156 | 9/13/2026 |
| 4.0.389 | 109 | 9/13/2026 |
| 4.0.388 | 114 | 9/13/2026 |
| 4.0.387 | 261 | 9/12/2026 |
| 4.0.386 | 110 | 9/12/2026 |
| 4.0.385 | 158 | 9/12/2026 |
| 4.0.384 | 134 | 9/12/2026 |
| 4.0.383 | 151 | 9/9/2026 |
| 4.0.382 | 97 | 9/9/2026 |
| 4.0.381 | 118 | 9/9/2026 |
| 4.0.380 | 98 | 9/9/2026 |
Remove unused dependencies and declare direct package references