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 <rep...@bugs.python.org> <http://bugs.python.org/issue10274> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com