Skip to content

Commit 19048c3

Browse files
committed
Add clarity to the warning on certificate verification in urllib.
1 parent 72acb66 commit 19048c3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Doc/library/urllib.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ reading, and no seek operations are available.
2626

2727
.. seealso::
2828

29-
The `Requests package <http://requests.readthedocs.org/>`_
29+
The `Requests package <http://docs.python-requests.org/>`_
3030
is recommended for a higher-level HTTP client interface.
3131

32-
.. warning:: When opening HTTPS URLs, it does not attempt to validate the
33-
server certificate. Use at your own risk!
32+
.. versionchanged:: 2.7.9
33+
34+
For HTTPS URIs, :mod:`urllib` performs all the neccessary certificate and hostname checks by default.
35+
36+
.. warning::
37+
38+
For Python versions earlier than 2.7.9, urllib does not attempt to validate the server certificates of HTTPS URIs. Use at your own risk!
3439

3540

3641
High-level interface
@@ -142,7 +147,7 @@ High-level interface
142147
:envvar:`no_proxy` environment variable.
143148

144149
.. versionchanged:: 2.7.9
145-
The *context* parameter was added.
150+
The *context* parameter was added. All the neccessary certificate and hostname checks are done by default.
146151

147152
.. deprecated:: 2.6
148153
The :func:`urlopen` function has been removed in Python 3 in favor

0 commit comments

Comments
 (0)