ssl - OpenSSL SSL_connect : SSL_ERROR_SYSCALL in connection to www. google.com:443

标签 ssl curl

我可以访问其他网站,如 Youtube、account.google.com 等,但 www.google.com 除外.当我尝试访问 www.google.com在 Chrome 浏览器中,它返回 www.google.com unexpectedly closed the connection.ERR_CONNECTION_CLOSED .
然后我尝试了 curl 。

$ curl -x http://127.0.0.1:1080 -v https://www.google.com
*   Trying 127.0.0.1:1080...
* Connected to 127.0.0.1 (127.0.0.1) port 1080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to www.google.com:443
> CONNECT www.google.com:443 HTTP/1.1
> Host: www.google.com:443
> User-Agent: curl/7.75.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.google.com:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.google.com:443
我在互联网上找不到类似的问题,现在我完全不知所措。为什么会发生这种情况,以及如何解决?
(我对SSL之类的东西不太熟悉,所以很抱歉我可能无法提供足够的信息。感谢您回答问题)
编辑:为了比较:
$ curl -x http://127.0.0.1:1080 -v https://www.youtube.com
*   Trying 127.0.0.1:1080...
* Connected to 127.0.0.1 (127.0.0.1) port 1080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to www.youtube.com:443
> CONNECT www.youtube.com:443 HTTP/1.1
> Host: www.youtube.com:443
> User-Agent: curl/7.75.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=Mountain View; O=Google LLC; CN=*.google.com
*  start date: Jan 19 07:57:09 2021 GMT
*  expire date: Apr 13 07:57:08 2021 GMT
*  subjectAltName: host "www.youtube.com" matched cert's "*.youtube.com"
*  issuer: C=US; O=Google Trust Services; CN=GTS CA 1O1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x56071ebe5910)
> GET / HTTP/2
> Host: www.youtube.com
> user-agent: curl/7.75.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200
< content-type: text/html; charset=utf-8
< x-content-type-options: nosniff
< cache-control: no-cache, no-store, max-age=0, must-revalidate
...(Normal site data)

最佳答案

您应该查找“https://github.com/ShadowsocksR-Live/shadowsocksr-native#sample-configure-file”,config.json 演示可能会帮助您解决这个问题。

关于ssl - OpenSSL SSL_connect : SSL_ERROR_SYSCALL in connection to www. google.com:443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66090119/

相关文章:

ssl - MediaWiki:验证后出现 500 内部服务器错误

r - 如何在 R 中使用 Torocks5 getURL

javascript - 从 chrome 扩展发布数据

php - 使用 curl 检查 301 http 响应

ssl - 与 Greenplum 数据库服务器的 SSL 通信是否不同于与典型 Web 服务器的正常 SSL 通信?

c# - 当服务器响应 TLS 1.1 时,.net 4.7 无法创建 SSL channel

python - 线程中的 SSL 错误与 python 中的简单发布请求

Java 连接到 https URL

php - 管理长时间运行的 php 脚本的最佳方法?

php - 如何使用 php ://memory file handle? 执行 cURL PUT 请求