我正在尝试按照“.NET 教程 - 5 分钟内的 Hello World”中的说明在 Centos 7 上安装 .net Core SDK 2.0.0。
当我运行第一个命令时
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
我收到此错误:
curl: (60) Peer's Certificate issuer is not recognized.
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
error: https://packages.microsoft.com/keys/microsoft.asc: import read failed(2)
我在公司代理后面,这个错误似乎与SSL证书和curl有关,但我不知道如何修复它。此外,当我使用curl或wget下载HTTPS URL时,我遇到了类似的错误。
sudo vi /etc/yum.conf
然后在编辑器上添加以下行
sslverify=false
openssl x509 -in xxx.cer -inform der -outform pem -out xxx.pem
)
yum install ca-certificates
update-ca-trust force-enable
/etc/pki/ca-trust/source/anchors/
update-ca-trust extract
将根添加到系统的可信证书中
https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them
http://manuals.gfi.com/en/kerio/connect/content/server-configuration/ssl-certificates/adding-trusted-root-certificates-to-the-server-1605.html
-days 365
增加到
-days 1400
,这大约是 4 年的保证。
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
您可以在“如何在 Apache CentOS 7 上创建 SSL 证书”中找到更多信息。
第1步:打开/etc/yum.conf进行编辑:
sudo nano /etc/yum.conf
第 2 步:在 [main] 下面添加此行
sslverify=0
假设您有名为 _.example.com.cer 的证书副本,您可以运行以下命令:
$ sudo yum install -y ca-certificates
$ sudo cp _.example.com.cer /usr/local/share/ca-certificates/
$ sudo update-ca-trust
我在 RHEL 服务器 (v7.9) 上运行这些命令。
我从浏览器下载了证书文件。在 Chrome 中,当您查看证书时,可以在“详细信息”选项卡下将其导出。参考:
https://ubuntu.com/server/docs/security-trust-store
我希望这有帮助。
第1步:编辑repo文件
sudo nano /etc/yum.repos.d/mssql-server.repo
第 2 步:包含 sslverify=false
[packages-microsoft-com-mssql-server-2022]
name=packages-microsoft-com-mssql-server-2022
baseurl=https://packages.microsoft.com/rhel/9.0/mssql-server-2022/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
sslverify=false
保存文件并退出文本编辑器(Ctrl+X .. Y)。清理并重试安装
sudo yum clean all
sudo yum install -y mssql-server
cd /etc/pki/ca-trust/extracted/pem
mv tls-ca-bundle.pem tls-ca-bundle.pem.back
wget --no-check-certificate https://curl.se/ca/cacert.pem
mv cacert.pem tls-ca-bundle.pem