Linux软件签名检查,解决Linux netcore https请求使用自签名证书忽略安全检查方法

当前系统环境:CentOS 7 x64. dotnet 2.0.不管是ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) = true;还是:HttpClient httpClient = new HttpClient(new HttpClientHandler() { ServerCertificateCustomValidationCallback = (a, b, c, d) = true });

都会发生错误:错误信息大致如下:(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").) --- 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.Http.CurlHandler.SslProvider.SetSslOptionsForUnsupportedBackend(EasyRequest easy, ClientCertificateProvider certProvider)at System.Net.Http.CurlHandler.SslProvider.SetSslOptions(EasyRequest easy, ClientCertificateOption clientCertOption)

解决方案:

# yum update(可选)# yum install openssl-devel gcc #安装openssl和gcc

# 安装指定版本的curl# wget https://curl.haxx.se/download/curl-7.55.1.tar.gz# tar -zxf curl-7.55.1.tar.gz# cd curl-7.55.1# ./configure --prefix=/usr/local/curl/ --without-nss --with-ssl=/usr/local/ssl/# make# make install

#备份原来的curlmv /usr/bin/curl /usr/bin/curl.bak

#将安装的curl 创建软连ln -s /usr/local/curl/bin/curl /usr/bin/curl# curl --version#差不多输出下面的内容#curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2k zlib/1.2.7

#增加lib搜索目录# vi /etc/ld.so.conf #增加# /usr/local/curl/lib# cat /etc/ld.so.conf 差不多下面这样子#include ld.so.conf.d/*.conf/usr/local/curl/lib

# 重新load配置# ldconfig

本文永久更新链接地址:https://www.linuxidc.com/Linux/2018-05/152543.htm

adhtyl4i5xp.gif Linux配置ssh免密远程登录 Windows Ubuntu Bash申请免费通配符证书(Let's Encrypt)并绑定IIS52eb0974411e0eea7b97d2eee3747642.gif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值