rak*_*aht 12 homebrew curl linuxbrew
我在我的服务器上安装了Linuxbrew 。但是,当我尝试运行任何命令时,我遇到了curl 问题(brew 使用它来获取其更新)。通常,当其他类似的工具出现此类问题时,它们会提供一个标志来使证书检查无效,并且curl它本身为您提供了使用该-k标志的可能性。
然而在brew的文档中我没有找到这样一个可用的标志。insecure因此,我的第二个猜测是在我家中放置的文件中设置标志.curlrc,将curl 不检查SSL 证书设置为默认值。
下面是我运行 bew 时的输出示例:
-bash-4.1$ brew update
==> Installing dependencies for curl: patchelf, zlib, binutils, linux-headers, glibc, m4, gmp, mpfr, libmpc, isl@0.18, gcc, pkg-config and openssl
==> Installing curl dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.10.x86_64_linux.bottle.tar.gz
curl: (60) Peer certificate cannot be authenticated with known CA certificates
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: Failed to download resource "patchelf"
Download failed: https://linuxbrew.bintray.com/bottles/patchelf-0.10.x86_64_linux.bottle.tar.gz
Run Code Online (Sandbox Code Playgroud)
rak*_*aht 28
为了让 Homebrew 接受.curlrc文件中指定的选项,需要设置一个标志。
根据文档:
\n\n\nHOMEBREW_CURLRC
\n
\n如果设置,则在调用curl(1) 时不要传递--disable,这将禁用curlrc。
因此,只需运行此脚本即可让自制程序忽略 SSL 证书验证:
\necho insecure >> ~/.curlrc\nHOMEBREW_CURLRC=1\nexport HOMEBREW_CURLRC\nbrew install \xe2\x80\xa6\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
6520 次 |
| 最近记录: |