一、访问 HTTPS 出现 “HTTP request failed” 的错误排除
环境
CentOS release 6.5 (Final)
起因
[root@localhost ~]# go get github.com/gorilla/mux
# cd .; git clone https://github.com/gorilla/mux /data0/app/gopath/src/github.com/gorilla/mux
Initialized empty Git repository in /data0/app/gopath/src/github.com/gorilla/mux/.git/
error: while accessing https://github.com/gorilla/mux/info/refs
fatal: HTTP request failed
package github.com/gorilla/mux: exit status 128
过程
1. 使用 git 命令测试
[root@localhost ~]# git clone https://github.com/gorilla/mux.git
Initialized empty Git repository in /root/golang/mux/.git/
error: while accessing https://github.com/gorilla/mux.git/info/refs
fatal: HTTP request failed
2. 使用 curl 测试
[root@localhost ~]# curl -v https://github.com/gorilla/mux.git
* About to connect() to github.com port 443 (#0)
* Trying 13.229.188.59... connected
* Connected to github.com (13.229.188.59) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -12190
* Closing connection #0
* SSL connect error
curl: (35) SSL connect error
发现是 SSL connect error
解决办法
yum update nss
更新网络安全服务。问题解决。