summaryrefslogtreecommitdiffstats
path: root/Doc/library/urllib.request.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2014-09-19 07:23:30 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2014-09-19 07:23:30 (GMT)
commita5c85b3f5fc12256680a93dda9d32138d47605de (patch)
tree8150c96aa51e8e20e0e54cf0603b7d9b9e9f9045 /Doc/library/urllib.request.rst
parentea07eb9469d1c93a26560a00f6e4ca45d4c1ecdb (diff)
downloadcpython-a5c85b3f5fc12256680a93dda9d32138d47605de.zip
cpython-a5c85b3f5fc12256680a93dda9d32138d47605de.tar.gz
cpython-a5c85b3f5fc12256680a93dda9d32138d47605de.tar.bz2
Issue #22366: urllib.request.urlopen will accept a context object (SSLContext)
as an argument which will then used be for HTTPS connection. Patch by Alex Gaynor.
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r--Doc/library/urllib.request.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index b588dad..07928ed 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, cadefault=False)
+.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=False, context=None)
Open the URL *url*, which can be either a string or a
:class:`Request` object.
@@ -47,6 +47,10 @@ The :mod:`urllib.request` module defines the following functions:
the global default timeout setting will be used). This actually
only works for HTTP, HTTPS and FTP connections.
+ If *context* is specified, it must be a :class:`ssl.SSLContext` instance
+ describing the various SSL options. See
+ :class:`~http.client.HTTPSConnection` for more details.
+
The optional *cafile* and *capath* parameters specify a set of trusted
CA certificates for HTTPS requests. *cafile* should point to a single
file containing a bundle of CA certificates, whereas *capath* should
@@ -111,6 +115,9 @@ The :mod:`urllib.request` module defines the following functions:
.. versionchanged:: 3.3
*cadefault* was added.
+ .. versionchanged:: 3.5
+ *context* was added.
+
.. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener.