用ssl安装curl所以我可以安装自制软件

Jos*_*eek 5 ssl homebrew curl ca

解决方案

我使用Bruno的帖子来找到解决方案,但觉得它需要更具体,所以这显然是我所做的.

  1. cacert.pem下载到我的〜/ .ssh目录中(我不知道这是不是应该去的地方,但我看到有人在尝试寻找解决方案时做了类似的事情,所以这就是我把它放在哪里).
  2. 为安装设置env var CURL_CA_BUNDLE.这实际上是失败建议的网站上的第4号解决方案.我只是误解了他们的意思(一个简单的例子可能让我节省了数小时的困惑).无论如何,您需要指定.pem文件的完整路径,然后您可以像这样安装然后安装它!$ CURL_CA_BUNDLE=~/.ssh/cacert.pem ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

原始问题

我该怎么做

  1. 安装自制软件,或者
  2. 使用SSL安装curl以便我可以安装自制软件?

我在Mac OSX Leopard上.

我正在尝试安装自制软件,但是我收到以下错误:

$ ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...
==> The following directories will be made group writable:
/usr/local/bin
/usr/local/lib
/usr/local/lib/pkgconfig
/usr/local/share/man/man1
/usr/local/share/man/man3

Press enter to continue
==> /usr/bin/sudo /bin/chmod g+w /usr/local/bin /usr/local/lib /usr/local/lib/pkgconfig /usr/local/share/man/man1 /usr/local/share/man/man3
==> Downloading and Installing Homebrew...
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
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). The default
 bundle is named curl-ca-bundle.crt; 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.

gzip: stdin: unexpected end of file
/usr/bin/tar: Child returned status 1
/usr/bin/tar: Error exit delayed from previous errors
Failed during: /bin/bash -o pipefail -c '/usr/bin/curl -sSfL https://github.com/mxcl/homebrew/tarball/master | /usr/bin/tar xz -m --strip 1'
Run Code Online (Sandbox Code Playgroud)

我尝试使用macports安装curl并指定+ ssl,但是这不起作用(对不起,我不记得错误是什么,并且花了大约一个小时才到达那一点,所以我不想这样做它再次).我从macports卸载curl然后运行$ whereis curl哪个找不到任何东西.

所以我转到上面的错误消息中建议的网站.大多数选项似乎不适用,但选项5有一定道理:

获得更好/不同/更新的CA证书捆绑!一种选择是通过在curl构建树根中运行'make ca-bundle'来提取最近Firefox浏览器使用的那个

所以我得到的卷曲的源代码和运行$ ./buildconf,$ ./configure,$ make,$ make ca-bundle,最后$ sudo make install.我检查$ whereis curl并说"/ usr/bin/curl".

但是当我再次运行homebrew install命令时(在新的终端窗口中),我得到了上面显示的相同错误.

Bru*_*uno 5

您不需要重新编译cURL,它已经具有SSL/TLS支持,否则,它将不会显示error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed.

您需要的是一组CA证书,例如您尝试与之通信的服务器的服务器证书由其中一个CA颁发.

您链接到的链接到http://curl.haxx.se/docs/caextract.html的cURL页面

您应该能够下载组合的PEM包并使用它.您可以curl -fsSL --cacert /path/to/bundle.pem https://...在上面的命令中强制使用它,或者export CURL_CA_BUNDLE=/path/to/bundle.pem在运行命令之前使用它.

通常情况下,您需要一种方法来信任此捆绑包中的内容,但在导入商业CA时,总会出现"信念的飞跃"(与大多数浏览器捆绑的方式相同).