@@ -16,7 +16,7 @@ authentication, redirections, cookies and more.
1616The :mod: `urllib.request ` module defines the following functions:
1717
1818
19- .. function :: urlopen(url, data=None[, timeout], *, cafile=None, capath=None)
19+ .. function :: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=True )
2020
2121 Open the URL *url *, which can be either a string or a
2222 :class: `Request ` object.
@@ -53,9 +53,15 @@ The :mod:`urllib.request` module defines the following functions:
5353 point to a directory of hashed certificate files. More information can
5454 be found in :meth: `ssl.SSLContext.load_verify_locations `.
5555
56+ The *cadefault * parameter specifies whether to fall back to loading a
57+ default certificate store defined by the underlying OpenSSL library if the
58+ *cafile * and *capath * parameters are omitted. This will only work on
59+ some non-Windows platforms.
60+
5661 .. warning ::
57- If neither *cafile * nor *capath * is specified, an HTTPS request
58- will not do any verification of the server's certificate.
62+ If neither *cafile * nor *capath * is specified, and *cadefault * is False,
63+ an HTTPS request will not do any verification of the server's
64+ certificate.
5965
6066 This function returns a file-like object that works as a :term: `context manager `,
6167 with two additional methods from the :mod: `urllib.response ` module
@@ -92,6 +98,9 @@ The :mod:`urllib.request` module defines the following functions:
9298 .. versionadded :: 3.2
9399 *data * can be an iterable object.
94100
101+ .. versionchanged :: 3.3
102+ *cadefault * was added.
103+
95104.. function :: install_opener(opener)
96105
97106 Install an :class: `OpenerDirector ` instance as the default global opener.
0 commit comments