ssl - 代理隧道失败 : Invalid request -- HOST header was not sent Unable to establish SSL connection

标签 ssl proxy wget

wget 无法通过代理服务器下载并显示以下消息:无效请求 -- HOST header 未发送无法建立 SSL 连接。

例子:

[root@foosrv0234ccpra ~]# wget https://packages.chef.io/stable/el/6/chefdk-0.18.26-1.el6.x86_64.rpm
--2016-09-27 16:57:44--  https://packages.chef.io/stable/el/6/chefdk-0.18.26-1.el6.x86_64.rpm
Resolving deehprx024ccpxa.ehn.sr.dev.sdc.mycomp.com (deehprx024ccpxa.ehn.sr.dev.sdc.mycomp.com)... 129.35.62.40
Connecting to deehprx024ccpxa.ehn.sr.dev.sdc.mycomp.com (deehprx024ccpxa.ehn.sr.dev.sdc.mycomp.com)|129.35.62.40|:8080... connected.
Proxy tunneling failed: Invalid request -- HOST header was not sentUnable to establish SSL connection.

[root@foosrv0234ccpra ~]# env|grep proxy
http_proxy=http://barsrvprx024ccpxa.ehn.sr.dev.sdc.mycomp.com:8080
https_proxy=http://barsrvprx024ccpxa.ehn.sr.dev.sdc.mycomp.com:8080
no_proxy=barsrvacp014ccpra,barsrvchf014ccpra.ssm.sdc.gts.mycomp.com,localhost,127.0.0.1,barsrvacp014ccpra.ssm.sdc.gts.mycomp.com

我花了一些时间来解决这个问题,所以我在 StackOverflow 上分享了这个问题。请查看下面的答案。

最佳答案

出现上述问题是因为HTTP 1.1 要求客户端提供HOST header ,而代理服务器不支持HTTP 1.1(有关详细信息,请参阅RFC 2616)这个要求)。

一些备选方案:

  • 升级您的代理以支持 HTTP 1.1
  • wget 降级到只支持 HTTP 1.0 的版本(wget v1.12 或以下)
  • 寻找另一种方法来强制使用 1.0 而不是 1.1 进行所有 HTTP 调用(我还没有探索这种可能性,我不确定如何去做......降级 wget 解决了我的问题)

关于ssl - 代理隧道失败 : Invalid request -- HOST header was not sent Unable to establish SSL connection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39755809/

相关文章:

mercurial - 当尝试通过代理服务器连接时,Windows 版 TortoiseHg 显示 "SSL error: unknown protocol"

java - 如何从需要按键的 URL 中获取

javascript - Opencart - 产品描述中插入的图片是 http 而不是 https

python - pymysql 无法使用 SSL 连接

java - Tomcat SSL 和 keystore

windows - 如何在 Windows 上查看代理设置?

php - 经过身份验证的 curl 在 php 中不起作用

Java 代理输出流因空字节而损坏

wget - 如何强制 wget 不进行 URL 编码?

linux - 使用 wget 下载 html 页面中的嵌入链接