diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-06 16:49:52 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-06 16:49:52 (GMT) |
commit | 0872816dc1fbe0bf3b126874a31afd8e37677ae3 (patch) | |
tree | c8dd24551a19d141485ba306d0817d1a5a9ad696 /Doc/library/imaplib.rst | |
parent | 45fd0c9931dbc25c2577e0b17672dffc36a03868 (diff) | |
download | cpython-0872816dc1fbe0bf3b126874a31afd8e37677ae3.zip cpython-0872816dc1fbe0bf3b126874a31afd8e37677ae3.tar.gz cpython-0872816dc1fbe0bf3b126874a31afd8e37677ae3.tar.bz2 |
Issue #8808: The IMAP4_SSL constructor now allows passing an SSLContext
parameter to control parameters of the secure channel. Patch by Sijin
Joseph.
Diffstat (limited to 'Doc/library/imaplib.rst')
-rw-r--r-- | Doc/library/imaplib.rst | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 1d92fe5..592e4b0 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -64,14 +64,21 @@ Three exceptions are defined as attributes of the :class:`IMAP4` class: There's also a subclass for secure connections: -.. class:: IMAP4_SSL(host='', port=IMAP4_SSL_PORT, keyfile=None, certfile=None) +.. class:: IMAP4_SSL(host='', port=IMAP4_SSL_PORT, keyfile=None, certfile=None, ssl_context=None) This is a subclass derived from :class:`IMAP4` that connects over an SSL encrypted socket (to use this class you need a socket module that was compiled with SSL support). If *host* is not specified, ``''`` (the local host) is used. If *port* is omitted, the standard IMAP4-over-SSL port (993) is used. *keyfile* and *certfile* are also optional - they can contain a PEM formatted private key - and certificate chain file for the SSL connection. + and certificate chain file for the SSL connection. *ssl_context* parameter is a + :class:`ssl.SSLContext` object which allows bundling SSL configuration + options, certificates and private keys into a single (potentially long-lived) + structure. Note that the *keyfile*/*certfile* parameters are mutually exclusive with *ssl_context*, + a :class:`ValueError` is thrown if *keyfile*/*certfile* is provided along with *ssl_context*. + + .. versionchanged:: 3.3 + *ssl_context* parameter added. The second subclass allows for connections created by a child process: |