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



我已经更新了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)

我还有其他选择吗?

首先检查 brew doctor 的输出。

如此处所示,强制重新安装openssl可能会有所帮助

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

如果没有,与此问题类似,您可以首先尝试安装较新的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

最新更新