centos7下asp.net core 2.0使用httpclient访问https资源

环境

  • centos7 64
  • dotnet core 2.0.3

问题

微信支付时须要使用证书访问接口,报以下错误 :html

System.PlatformNotSupportedException: The handler does not support client authentication certificates with this combination of libcurl (7.29.0) and its SSL backend ("NSS/3.28.4").

分析

提示很明显,是由于操做系统的libcurl不支持ssl形成的。linux

解决

  • 安装openssl并生成lib库
  • 安装curl到指定版本

具体过程,请参考 https://www.latoooo.com/xia_z...segmentfault

  • 最核心的点,安装完成后要将curl的lib下的so文件复制到/usr/lib,或者加到lib搜索目录中。

总结

linux也跟windows同样,有支持的库,windows上就是一个个的dll,而linux就是so文件。windows

相关文章
相关标签/搜索