标签:
一、导入证书
二、安装授权工具
1.下载 winhttpcertcfg.exe 安装
2.安装完
三、代码中使用导入好的证书
HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(strURL);
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
ServicePointManager.ServerCertificateValidationCallback =
(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => { returntrue; };
//查找系统导入的证书
X509Store certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
certStore.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certCollection = certStore.Certificates.Find(X509FindType.FindBySubjectName, "test", false);
//请求代码略...
IIS7下 【请求被中止: 未能创建 SSL/TLS 安全通道 】 解决方法
标签:
原文地址:http://www.cnblogs.com/MKOne/p/5390492.html