0

我有一个有趣的要求是通过隧道连接openssl s_clienthttps网站。https

proxy_host.com我已经设法通过这个代理target_host.com

但是,当我尝试发送GET / HTTP/1.1后跟两个时enter,什么都没有发送(或者什么都没有到达 target_host.

以下是我目前正在使用的内容:

echo "CONNECT target_host.com:443 HTTP/1.1\r\nHost:proxy_host.com\r\nConnection: Keep-Alive\r\n\r\n" | openssl s_client -ign_eof -connect proxy_host.com:443

我只得到:

HTTP/1.0 200 
Connection Established 
Proxy-agent: Apache/2.2.15 (Red Hat)

我必须添加 Host 标头,因为这是我的代理的要求。最终,我想向网络服务器发送一个 GET 请求,但我正在使用 nc 来查看正在通过什么。

4

1 回答 1

0

这实际上比我想象的使用 curl 更容易,如下所示:

curl --proxy-insecure --proxy proxy_host.com:443 --proxy-header "Host: proxy_host.com" -k https://target_host.com:443
于 2020-12-05T17:06:22.367 回答