开发者

How to process custom certificates in HTTPS?

开发者 https://www.devze.com 2023-01-11 00:11 出处:网络
I am trying to fetch a page using HttpWebRequest, but I am getting this exception: Could not establish trust relationship for the SSL/TLS secure channel.

I am trying to fetch a page using HttpWebRequest, but I am getting this exception:

Could not establish trust relationship for the SSL/TLS secure channel.

Is it possible to specify a custom RemoteCertificateValidationCallback for a particular instance of HttpWebRequest?

(I cannot use ServicePointManager.ServerCertificateValidationCallback, sinc开发者_如何学Pythone my code is part of a library.)


I cannot use ServicePointManager.ServerCertificateValidationCallback, since my code is part of a library

Do this, but filter calls to the delegate based on sender?

Update: Based on feedback: It might be necessary to spin up an AppDomain to do this (which will avoid interference with other things happening in the same process).

0

精彩评论

暂无评论...
验证码 换一张
取 消