命令
go install -v golang.org/x/tools/cmd/godoc@latest
失败并显示消息
proxyconnect tcp: tls: 第一条记录看起来不像 TLS 握手
我认为原因是我位于一个公司代理后面,该代理不使用 https 来从我的客户端(我的 Windows 盒子)到代理服务器进行通信。
C:\>reg query HKEY_CURRENT_USER\Environment
和proxy
的windows用户环境变量no_proxy
是这样设置的
C:\>reg query HKEY_CURRENT_USER\Environment | findstr /R .PROXY.
HTTP_PROXY=http://myuser:[email protected]:port
HTTPS_PROXY=https://myuser:[email protected]:port
NO_PROXY=localhost,127.0.0.1,.foo.mycompany,.mycompany.com,.someplace.mycompany,localhost:5001
将
HTTPS_PROXY
的值从 https://myuser...
更改为 http://myuser...
没有任何区别。 http 的 git config git config -l
有这些设置
C:\>git config -l | findstr /R http.
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
http.proxy=http://myuser:[email protected]:port
http.sslverify=false
https.proxy=http://myuser:[email protected]:port
我必须做什么
go install
proxyconnect tcp: tls: first record does not look like a TLS handshake
确保您的代理实际上支持该端口上的 HTTPS。
尝试 openssl s_client -connect proxy.company:port。
如果不支持,请尝试将变量更改为:HTTPS_PROXY=http://myuser:[email protected]:port (https -> http)