微信请求数据错误The request was aborted: Could not create SSL/TLS secure channel.

时间:2015-10-30 12:18:20   收藏:0   阅读:474

今天在后台向微信服务器请求JSON数据时,返回了错误:The request was aborted: Could not create SSL/TLS secure channel.

查了一下,原来去年SSL协议曝出高危漏洞后,微信公众平台关闭了SSLv2、SSLv3版本支持,请求数据时应该使用TLS或更高版本。

//在请求之前修改安全协议为TLS
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

 

至于SSL和TLS的区别,参考这篇文章:http://hengstart.iteye.com/blog/840561

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!