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

  • Post author:
  • Post category:其他


今天在后台向微信服务器请求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

转载于:https://www.cnblogs.com/sxxsw/p/4922858.html