[issue10274] imaplib should provide a means to validate a remote server ssl certificate(s)

Christian Heimes report at bugs.python.org
Thu Sep 8 10:28:18 EDT 2016


Christian Heimes added the comment:

You can use a custom ssl context to enforce cert and hostname validation:

>>> import imaplib, ssl
>>> ctx = ssl.create_default_context()
>>> conn = imaplib.IMAP4_SSL("74.125.133.109", ssl_context=ctx)
Traceback (most recent call last):
...
ssl.CertificateError: hostname '74.125.133.109' doesn't match 'imap.gmail.com'

----------
nosy: +christian.heimes
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10274>
_______________________________________


More information about the Python-bugs-list mailing list