禁用 SSL 检查 rpm

Ant*_*ito 15 ssl rpm curl centos7

尝试运行任何 rpm 命令时,出现以下错误。我不确定为什么会出现 curl 错误,但我尝试了许多不同的选项,但都失败了。

运行 CentOS7 并在代理后面

[root@CentOS7]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
curl: (60) Peer's certificate issuer has been marked as not trusted by the user.
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: skipping https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - transfer failed
Run Code Online (Sandbox Code Playgroud)

所以我根据我认为有效的网站进行了检查。

[root@CentOS7]# curl -k https://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://www.google.com/">here</A>.
</BODY></HTML>
Run Code Online (Sandbox Code Playgroud)

我在代理后面并运行了导出命令。

export https_proxy=https://USERNAME:PASSWORD@my.proxy.com:8080/
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  1. curl -k 到 rpm 的等价物是什么?

  2. 是否有 curl.config 我可以告诉 curl 不检查 ssl 证书?我读过这是一个坏主意,但我已经在不同的服务器上测试了两个存储库,但没有给我错误,也不在代理后面。

  3. 我不确定 rpm 与 curl 的关系,但我假设因为我收到 curl 错误,curl 是导致错误的那个?

我对 rpm 和 curl 都做了 RTM,但不知道需要做什么。我确实在某个地方读过我需要导入密钥或其他东西,但我不确定我应该在那里做什么。

Joe*_*gan 15

你需要做的是:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Run Code Online (Sandbox Code Playgroud)

如果您仍然收到 SSL 警告,请尝试:

wget --no-check-certificate https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Run Code Online (Sandbox Code Playgroud)

然后你可以

rpm -Uvh webtatic-release.rpm
Run Code Online (Sandbox Code Playgroud)

哪个应该显示在这里:

ll /etc/yum.repos.d
Run Code Online (Sandbox Code Playgroud)