imaplib: how to specify SSL/TLS protocol version?

Grant Edwards invalid at invalid.invalid
Wed Apr 9 16:12:04 EDT 2014


Connecting to Exchange server fails like this:

 File "/usr/lib64/python2.7/imaplib.py", line 1148, in __init__
   IMAP4.__init__(self, host, port)
 SSLError: [Errno 1] _ssl.c:1419: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

Experiments show that when calling ssl.wrap_socket() I have to specify
ssl_version=PROTOCOL_TLSv1 to avoid the above error.

How do I tell imaplib to use TLS1 instead of SSL3?

-- 
Grant Edwards               grant.b.edwards        Yow! UH-OH!!  We're out
                                  at               of AUTOMOBILE PARTS and
                              gmail.com            RUBBER GOODS!



More information about the Python-list mailing list