In my private fetchmail Python script, I use ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_context.set_ciphers('AES256-SHA') server = IMAPClient(HOST, ssl_context=ssl_context, use_uid=True, ssl=ssl) This works just fine with Python3.9 and below. But with Python3.10 I get Traceback (most recent call last): File "/home/jarausch/bin/fetchmail_Skynet", line 171, in <module> server = IMAPClient(HOST, ssl_context=ssl_context, use_uid=True, ssl=ssl) File "/usr/lib/python3.10/site-packages/imapclient/imapclient.py", line 284, in __init__ self._imap = self._create_IMAP4() File "/usr/lib/python3.10/site-packages/imapclient/imapclient.py", line 321, in _create_IMAP4 return tls.IMAP4_TLS( File "/usr/lib/python3.10/site-packages/imapclient/tls.py", line 44, in __init__ imaplib.IMAP4.__init__(self, host, port) File "/usr/lib/python3.10/imaplib.py", line 202, in __init__ self.open(host, port, timeout) File "/usr/lib/python3.10/site-packages/imapclient/tls.py", line 52, in open self.sock = wrap_socket(sock, self.ssl_context, host) File "/usr/lib/python3.10/site-packages/imapclient/tls.py", line 32, in wrap_socket return ssl_context.wrap_socket(sock, server_hostname=host) File "/usr/lib/python3.10/ssl.py", line 512, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.10/ssl.py", line 1061, in _create self._sslobj = self._context._wrap_socket( ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:805) Many thanks for some hints on what has changed in Python3.10 here. Helmut
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d03a3b62fd6d8a615a20ef4424a6e031be2b5fe commit 6d03a3b62fd6d8a615a20ef4424a6e031be2b5fe Author: Sam James <sam@gentoo.org> AuthorDate: 2022-06-21 05:47:10 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-06-21 05:47:47 +0000 dev-python/imapclient: fix Python 3.10+ Closes: https://bugs.gentoo.org/835498 Signed-off-by: Sam James <sam@gentoo.org> dev-python/imapclient/Manifest | 1 + .../files/imapclient-2.2.0-ssl-context.patch | 13 +++++++++ dev-python/imapclient/imapclient-2.2.0-r1.ebuild | 31 ++++++++++++++++++++++ 3 files changed, 45 insertions(+)