Bug with imap.gmail.com and getmail TLS validation

Matt Smith <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <CAD0n1vGF5kdXPpsMEZQ0xOrU9UO+r7AqG6r=w6oHLFy3KnMNfA@mail.gmail.com>
Hi,

If using imap.gmail.com with the ca_certs option configured to point
at a valid set of CA root certificates then the certificate validation
fails with the following error:

gmail: operation error (socket sslerror during connect ([SSL:
CERTIFICATE_VERIFY_FAILED] certificate verify
failed (_ssl.c:726)))

If you try the same connection using openssl s_client then it
successfully connects and validates.

The reason appears to be an issue with TLSv1.3. If you set ssl_version
= tlsv1_2 in the getmail config then it works as expected.

Googling for a similar issue has shown me this thread:
https://github.com/OfflineIMAP/offlineimap/issues/573 which suggests
that it's something to do with imaplib2 not supporting TLSv1.3 + SNI.
I guess getmail uses the same lib?

It looks like the upstream imaplib2 is completely abandoned. So I
don't know what the best solution is going to be.

Thanks, Matt.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.