Skip to content

Instantly share code, notes, and snippets.

@wsky
Created July 31, 2012 07:16
Show Gist options
  • Save wsky/3214456 to your computer and use it in GitHub Desktop.
Save wsky/3214456 to your computer and use it in GitHub Desktop.
servicePointManager
//解决部分服务器证书问题
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(delegate { return true; });
//以下可选,强制协议
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
ServicePointManager.Expect100Continue = true;
<system.net>
<settings>
<servicePointManager checkCertificateRevocationList="true"/>
</settings>
</system.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment