CentOS7 .NETCore HTTPS 请求

异常信息
System.PlatformNotSupportedException: The handler does not support custom handling of certificates with this combination of libcurl (7.29.0) and its SSL backend (\"NSS/3.28.4\")
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.GetWebResponse(WebRequest request)
at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream)
更新curl

下载最新版

wget https://curl.haxx.se/download/curl-7.57.0.tar.gz

# 官方地址:https://curl.haxx.se/download.html

解压编译

# yum install openssl-devel gcc #安装openssl和gcc

tar -zxf curl-7.57.0.tar.gz

cd curl-7.57.0

./configure --prefix=/usr/local/curl/ --without-nss --with-ssl=/usr/local/ssl/

make && make install
替换系统curl

备份curl

mv /usr/bin/curl /usr/bin/curl.bak

创建link

ln -s /usr/local/curl/bin/curl /usr/bin/curl

编辑ld.so.conf

vi /etc/ld.so.conf 
include ld.so.conf.d/*.conf
/usr/local/curl/lib
验证安装

重新load配置

ldconfig

查看版本

curl -V

参考文章:
https://www.cnblogs.com/calvinK/p/8086046.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值