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

环境

  • centos7 64
  • dotnet core 2.0.3

问题

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

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造成的。

解决

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

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

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

总结

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

你可能感兴趣的:(httpclient,ssl,centos7,asp.net-core)