OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to imap.gmail.com:993

Hongyi Zhao hongyi.zhao at gmail.com
Wed Aug 25 04:43:42 UTC 2021


I'm on Ubuntu 20.04.2 LTS, and test Gmail using the IMAP protocol as follows:

```
$ curl -vx socks5h://127.0.0.1:18889 --ssl imaps://imap.gmail.com:993
--user "hszhao.cn:passwd"
*   Trying 127.0.0.1:18889...
* TCP_NODELAY set
* SOCKS5 communication to imap.gmail.com:993
* SOCKS5 connect to imap.gmail.com:993 (remotely resolved)
* SOCKS5 request granted.
* Connected to 127.0.0.1 (127.0.0.1) port 18889 (#0)
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to imap.gmail.com:993
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to
imap.gmail.com:993
```

While the other testing will succeed:

```
$ curl -vx socks5h://127.0.0.1:7891 --ssl imaps://imap.gmail.com:993
--user "hszhao.cn:passwd"
*   Trying 127.0.0.1:7891...
* TCP_NODELAY set
* SOCKS5 communication to imap.gmail.com:993
* SOCKS5 connect to imap.gmail.com:993 (remotely resolved)
* SOCKS5 request granted.
* Connected to 127.0.0.1 (127.0.0.1) port 7891 (#0)
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* 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
* Server certificate:
*  subject: CN=imap.gmail.com
*  start date: Aug 16 03:04:33 2021 GMT
*  expire date: Nov  8 03:04:32 2021 GMT
*  subjectAltName: host "imap.gmail.com" matched cert's "imap.gmail.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< * OK Gimap ready for requests from 103.138.53.176 q24mb12571169jar
> A001 CAPABILITY
< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST
CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN
AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER AUTH=XOAUTH
< A001 OK Thats all she wrote! q24mb12571169jar
> A002 AUTHENTICATE PLAIN AGhzemhhby5jbgBHblVUZVgyNjUxMDM5
< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST
CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE
ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE
APPENDLIMIT=35651584
< A002 OK hszhao.cn at gmail.com authenticated (Success)
> A003 LIST "" *
< * LIST (\HasNoChildren) "/" "INBOX"
* LIST (\HasNoChildren) "/" "INBOX"
< * LIST (\HasNoChildren) "/" "Junk"
* LIST (\HasNoChildren) "/" "Junk"
< * LIST (\HasChildren \Noselect) "/" "[Gmail]"
* LIST (\HasChildren \Noselect) "/" "[Gmail]"
< * LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
< * LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
< * LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
< * LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
< * LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
< * LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
< * LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
< * LIST (\HasNoChildren) "/" "&XeVPXJCuTvY-"
* LIST (\HasNoChildren) "/" "&XeVPXJCuTvY-"
< * LIST (\HasNoChildren) "/" "&ZTZjbg-"
* LIST (\HasNoChildren) "/" "&ZTZjbg-"
< * LIST (\HasNoChildren) "/" "&ZcWITHb4UXM-"
* LIST (\HasNoChildren) "/" "&ZcWITHb4UXM-"
< * LIST (\HasNoChildren) "/" "&ecFOupCuTvY-"
* LIST (\HasNoChildren) "/" "&ecFOupCuTvY-"
< A003 OK Success
* Connection #0 to host 127.0.0.1 left intact
```

Any hints for this problem?

Regards,
HY
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao at gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province


More information about the openssl-users mailing list