使用仅限 http 的客户端连接到 https 服务

Ste*_*eve 5 windows proxy https http

是否有一个简单的命令行客户端可以像这样调用:

http2https --listen localhost:80 --connect example.com:443
Run Code Online (Sandbox Code Playgroud)

这将允许我https://example.com通过实际连接到来有效地连接到http://localhost?它需要在 Windows 上运行。

我尝试过 stunnel,但似乎不起作用。

更新:

这是输出stunnel.exe -c -r google.com:443 -d 127.0.0.1:8888

No limit detected for the number of clients
stunnel 4.56 on x86-pc-msvc-1500 platform
Compiled/running with OpenSSL 1.0.1e-fips 11 Feb 2013
Threading:WIN32 Sockets:SELECT,IPv6 SSL:ENGINE,OCSP,FIPS
Reading configuration from file -c
Cannot read configuration

Syntax:
stunnel [ [-install | -uninstall] [-quiet] [<filename>] ] | -help | -version | -sockets
    <filename>  - use specified config file
    -install    - install NT service
    -uninstall  - uninstall NT service
    -quiet      - don't display a message box on success
    -help       - get config file help
    -version    - display version and defaults
    -sockets    - display default socket options

Server is down
Run Code Online (Sandbox Code Playgroud)

小智 5

Paul 的说法几乎是正确的,但在 Windows 下,您需要将client = yes添加到配置文件中,因为-c不是 Windows stunnel 的命令行参数。

以下配置对我有用

[remote]
client = yes
accept = 8888
connect = google.com:443
Run Code Online (Sandbox Code Playgroud)

我最终使用 tstunnel.exe 而不是 stunnel.exe,因为它是 Windows 中 stunnel 的命令行版本。这是命令:

tstunnel remote_stunnel.conf
Run Code Online (Sandbox Code Playgroud)


Pau*_*aul 3

stunnel 就是你所追求的:

sudo stunnel -c -r google.com:443 -d 127.0.0.1:8888
Run Code Online (Sandbox Code Playgroud)

这将设置与远程方(本例中为 Google)的 SSL 会话,并在本地主机端口 8888 上创建侦听器。如果您还没有侦听器,则可以使用 80。

然后访问 localhost:8888,您将获得远程站点。

如果您使用的是 Windows,则不支持命令行选项,因此请使用stunnel.conf以下参数创建一个文件:

[remote]
accept = 8888
connect = google.com:443
Run Code Online (Sandbox Code Playgroud)

然后调用它

stunnel -c stunnel.conf
Run Code Online (Sandbox Code Playgroud)