title: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.google.com:443
body: <p>I'm able to access other websites like Youtube, account.google.com etc except <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a>. When I try to access <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a> in the chromium browser, it returns <code>www.google.com unexpectedly closed the connection.</code> and <code>ERR_CONNECTION_CLOSED</code>.</p>
  <p>Then I tried with curl.</p>
  <pre><code>$ 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
  &gt; CONNECT www.google.com:443 HTTP/1.1
  &gt; Host: www.google.com:443
  &gt; User-Agent: curl/7.75.0
  &gt; Proxy-Connection: Keep-Alive
  &gt;
  &lt; HTTP/1.1 200 Connection established
  &lt;
  * 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
  </code></pre>
  <p>I can't find a similar problem on the internet and now I'm at complete loss. Why does this happen, and how to fix it?</p>
  <p>(I'm not quite familiar with stuffs like SSL, so I'm sorry that I may not able to give enough information. Thanks for answering the question)</p>
  <p>EDIT: For comparison:</p>
  <pre><code>$ 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
  &gt; CONNECT www.youtube.com:443 HTTP/1.1
  &gt; Host: www.youtube.com:443
  &gt; User-Agent: curl/7.75.0
  &gt; Proxy-Connection: Keep-Alive
  &gt;
  &lt; HTTP/1.1 200 Connection established
  &lt;
  * 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 &quot;www.youtube.com&quot; matched cert's &quot;*.youtube.com&quot;
  *  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)
  &gt; GET / HTTP/2
  &gt; Host: www.youtube.com
  &gt; user-agent: curl/7.75.0
  &gt; accept: */*
  &gt;
  * 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)!
  &lt; HTTP/2 200
  &lt; content-type: text/html; charset=utf-8
  &lt; x-content-type-options: nosniff
  &lt; cache-control: no-cache, no-store, max-age=0, must-revalidate
  ...(Normal site data)
  </code></pre>