有什么办法可以让 RestSharp 忽略 SSL 证书中的错误?我有一个测试客户端,我连接的服务还没有有效的证书。
当我现在提出请求时,我收到错误消息:

The underlying connection was closed: Could not establish trust
relationship for the SSL/TLS secure channel.

最佳答案

正如约翰所建议的:

ServicePointManager.ServerCertificateValidationCallback +=
        (sender, certificate, chain, sslPolicyErrors) => true;

关于https - RestSharp - 忽略 SSL 错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10397736/

10-16 23:39