https://github.com/python/cpython/commit/69fcc3f5bf10018ec8fedd98adf809062bb18bd4 commit: 69fcc3f5bf10018ec8fedd98adf809062bb18bd4 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-07-02T07:25:58Z summary:
[3.13] gh-72507: Document that imaplib does not verify TLS certificates by default (GH-152778) (GH-152864) IMAP4_SSL() and IMAP4.starttls() do not verify the server certificate or hostname unless a suitable ssl_context is passed. (cherry picked from commit f3bf8abb8c0f4cb20bed3dc7d98eca4a2d668709) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> files: M Doc/library/imaplib.rst diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 8e77f7db925d983..a71b4553c3d3874 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -96,6 +96,13 @@ There's also a subclass for secure connections: (potentially long-lived) structure. Please read :ref:`ssl-security` for best practices. + .. note:: + + With the default *ssl_context*, the connection is encrypted but the + server certificate and hostname are not verified. + To verify them, pass a context created by + :func:`ssl.create_default_context`. + The optional *timeout* parameter specifies a timeout in seconds for the connection attempt. If timeout is not given or is ``None``, the global default socket timeout is used. @@ -501,6 +508,13 @@ An :class:`IMAP4` instance has the following methods: encryption on the IMAP connection. Please read :ref:`ssl-security` for best practices. + .. note:: + + With the default *ssl_context*, the connection is encrypted but the + server certificate and hostname are not verified. + To verify them, pass a context created by + :func:`ssl.create_default_context`. + .. versionadded:: 3.2 .. versionchanged:: 3.4 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
