为什么curl在使用代理时无法访问网站

为什么curl在使用代理时无法访问网站

我使用的是 macOS 13 并在终端中设置代理,如下所示:

➜  depot_tools git:(d9e2d479) env|grep all_proxy
all_proxy=socks5://127.0.0.1:7890

然后我使用这样的curl命令:

➜  depot_tools git:(d9e2d479) curl -L -v https://www.facebook.com
* Uses proxy env variable all_proxy == 'socks5://127.0.0.1:7890'
*   Trying 127.0.0.1:7890...
* SOCKS5 connect to IPv4 31.13.76.99:443 (locally resolved)
* SOCKS5 request granted.
* Connected to (nil) (127.0.0.1) port 7890 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.facebook.com:443
* Closing connection 0
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.facebook.com:443

我确信它127.0.0.1:7890可以工作,因为我可以在 google chrome 中使用它来访问 facebook。我是否遗漏了什么,可以解决这个问题吗?

相关内容