You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,7 @@ Once the handler sends a request, these settings become immutable and cannot be
212
212
|MaxIdlePerHost|Gets or sets the maximum idle connection per host allowed in the pool. Default is usize::MAX (no limit).|
213
213
|Http2Only|Gets or sets a value that indicates whether to force the use of HTTP/2.|
214
214
|SkipCertificateVerification|Gets or sets a value that indicates whether to skip certificate verification.|
215
+
|OnVerifyServerCertificate|Gets or sets a custom handler that validates server certificates.|
215
216
|RootCertificates|Gets or sets a custom root CA. By default, the built-in root CA (Mozilla's root certificates) is used. See also https://github.com/rustls/webpki-roots.|
216
217
|ClientAuthCertificates|Gets or sets a custom client auth key.|
217
218
|ClientAuthKey|Gets or sets a custom client auth certificates.|
@@ -280,6 +281,22 @@ using var handler = new YetAnotherHttpHandler() { RootCertificates = rootCerts }
280
281
### Ignore certificate validation errors
281
282
We strongly not recommend this, but in some cases, you may want to skip certificate validation when connecting via HTTPS. In this scenario, you can ignore certificate errors by setting the `SkipCertificateVerification` property to `true`.
282
283
284
+
### Handling server certificate verification
285
+
You can customize the server certificate verification process by setting the `OnVerifyServerCertificate` property.
286
+
287
+
The callback should return `true` or `false` based on the verification result. If the property is set, the root CA verification is not performed.
if(YahaEventSource.Log.IsEnabled())YahaEventSource.Log.Warning($"OnServerVerification: The verification callback was called, but onServerCertificateVerification is null.");
0 commit comments