在OSX中用Brew安装Hugo依赖项时出现问题。 SSL警报协议版本

时间:2019-01-01 21:08:39

标签: github openssl homebrew hugo

我已经更新了brew和openssl,但是在运行brew install hugo时仍然出现以下错误:

MyMac:temp MyUser$ brew install hugo
Updating Homebrew...
==> Downloading https://github.com/gohugoio/hugo/archive/v0.53.tar.gz
Already downloaded: /Users/MyUser/Library/Caches/Homebrew/downloads/98345eef182a35281fb597a40ad17badc1bd1566127fb3eadd309204db690975--hugo-0.53.tar.gz
==> go build -o /usr/local/Cellar/hugo/0.53/bin/hugo -tags extended main.go
Last 15 lines from /Users/MyUser/Library/Logs/Homebrew/hugo/01.go:
    fatal: unable to access 'https://github.com/eknkc/amber/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
go: github.com/nfnt/resize@v0.0.0-20180221191011-83c6a9932646: git fetch -f https://github.com/nfnt/resize refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/MyUser/Library/Caches/Homebrew/go_cache/pkg/mod/cache/vcs/3c41db3334414b5559791060aadeb7b9a9cd6323146d18c88ea1134dabc06c55: exit status 128:
    fatal: unable to access 'https://github.com/nfnt/resize/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

但是,当我尝试直接访问任何依赖项时,都没错...

MyMac:temp MyUser$ git clone https://github.com/nfnt/resize.git
Cloning into 'resize'...
remote: Enumerating objects: 466, done.
remote: Total 466 (delta 0), reused 0 (delta 0), pack-reused 466
Receiving objects: 100% (466/466), 123.19 KiB | 0 bytes/s, done.
Resolving deltas: 100% (263/263), done.
Checking connectivity... done.

版本

MyMac:temp MyUser$ openssl version
OpenSSL 1.0.2q  20 Nov 2018

MyMac:temp MyUser$ brew -v
Homebrew 1.8.6

MyMac:temp MyUser$ git --version
git version 2.5.4 (Apple Git-61)

我还有其他选择吗?

1 个答案:

答案 0 :(得分:0)

首先检查brew doctor的输出。

seen here一样,强制重新安装openssl可能会有帮助

cd /usr/bin
rm -r openssl
brew install openssl
brew update && brew upgrade

如果没有,则类似于this issue,您可以先尝试安装更新的curl并构建使用系统提供的较新的库的更新的git

brew reinstall curl
brew link --force curl
brew reinstall --build-from-source git
brew update

确保which curlwhich git返回/usr/local/bin/curl/usr/local/bin/git