大网数据广告活动
服务器运维问答

https through an http-only proxy?

· 52CE 我爱测

My organisation directs all traffic through a proxy. As proxy settings, we are required to use an http proxy setting for both the http_proxy & https_proxy environment variables. If I set the https_proxy variable to an https versi…

问题原文

原帖链接 · physkets · CC BY-SA 3.0

My organisation directs all traffic through a proxy. As proxy settings, we are required to use an http proxy setting for both the http_proxy & https_proxy environment variables.

If I set the https_proxy variable to an https version of the same proxy, some programs the use the https_proxy env variable cease to work.

So does this mean that the proxy does not support https connections? What about https websites that load normally in my browser?

已采纳解答

原帖链接 · Fredi · CC BY-SA 3.0

Beware when you set http_proxy and https_proxy, normally you should set them at the same URL including the schema part, example:

http_proxy=http://your_proxy:proxy_port
https_proxy=http://your_proxy:proxy_port

Notice that both are in HTTP. That tells you the protocol your proxy uses, not the target website's schema, which can be HTTP or HTTPS, that is not related.

When, using the proxy for connecting to a HTTPS website, the proxy works in TCP mode, and (I'm simplifying here) your TCP connection passes through the proxy carrying encrypted packets from your client to the target website.

So, try setting your https_proxy environment variable the same as your http_proxy and hope you're allowed to use the CONNECT method.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-11-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。