由于代理和tls握手,go安装失败

问题描述 投票:0回答:1

命令

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
go installation proxy http-proxy handshake
1个回答
0
投票

确保您的代理实际上支持该端口上的 HTTPS。

尝试 openssl s_client -connect proxy.company:port。

如果不支持,请尝试将变量更改为:HTTPS_PROXY=http://myuser:[email protected]:port (https -> http)

© www.soinside.com 2019 - 2024. All rights reserved.