diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-05-16 19:40:01 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-05-16 19:40:01 (GMT) |
commit | de9ac6c2e5b5887e473a24f067942dcf306ed3d3 (patch) | |
tree | 4116086b6516d72bd6bc228dcb62e0258cb90c18 /Doc/library | |
parent | 5d953184a6fae25bf27e769c90b419d9b2aa1af9 (diff) | |
download | cpython-de9ac6c2e5b5887e473a24f067942dcf306ed3d3.zip cpython-de9ac6c2e5b5887e473a24f067942dcf306ed3d3.tar.gz cpython-de9ac6c2e5b5887e473a24f067942dcf306ed3d3.tar.bz2 |
Issue #14780: urllib.request.urlopen() now has a `cadefault` argument to use the default certificate store.
Initial patch by James Oakley.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/urllib.request.rst | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index bce00b3..cd90a80 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -16,7 +16,7 @@ authentication, redirections, cookies and more. The :mod:`urllib.request` module defines the following functions: -.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None) +.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=True) Open the URL *url*, which can be either a string or a :class:`Request` object. @@ -53,9 +53,15 @@ The :mod:`urllib.request` module defines the following functions: point to a directory of hashed certificate files. More information can be found in :meth:`ssl.SSLContext.load_verify_locations`. + The *cadefault* parameter specifies whether to fall back to loading a + default certificate store defined by the underlying OpenSSL library if the + *cafile* and *capath* parameters are omitted. This will only work on + some non-Windows platforms. + .. warning:: - If neither *cafile* nor *capath* is specified, an HTTPS request - will not do any verification of the server's certificate. + If neither *cafile* nor *capath* is specified, and *cadefault* is False, + an HTTPS request will not do any verification of the server's + certificate. This function returns a file-like object that works as a :term:`context manager`, with two additional methods from the :mod:`urllib.response` module @@ -92,6 +98,9 @@ The :mod:`urllib.request` module defines the following functions: .. versionadded:: 3.2 *data* can be an iterable object. + .. versionchanged:: 3.3 + *cadefault* was added. + .. function:: install_opener(opener) Install an :class:`OpenerDirector` instance as the default global opener. |