Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(32559)

Side by Side Diff: Doc/library/urllib.request.rst

Issue 22417: PEP 476: verify HTTPS certificates by default
Patch Set: Created 4 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 :mod:`urllib.request` --- Extensible library for opening URLs 1 :mod:`urllib.request` --- Extensible library for opening URLs
2 ============================================================= 2 =============================================================
3 3
4 .. module:: urllib.request 4 .. module:: urllib.request
5 :synopsis: Extensible library for opening URLs. 5 :synopsis: Extensible library for opening URLs.
6 .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu> 6 .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu>
7 .. sectionauthor:: Moshe Zadka <moshez@users.sourceforge.net> 7 .. sectionauthor:: Moshe Zadka <moshez@users.sourceforge.net>
8 .. sectionauthor:: Senthil Kumaran <senthil@uthcode.com> 8 .. sectionauthor:: Senthil Kumaran <senthil@uthcode.com>
9 9
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 The optional *cafile* and *capath* parameters specify a set of trusted 54 The optional *cafile* and *capath* parameters specify a set of trusted
55 CA certificates for HTTPS requests. *cafile* should point to a single 55 CA certificates for HTTPS requests. *cafile* should point to a single
56 file containing a bundle of CA certificates, whereas *capath* should 56 file containing a bundle of CA certificates, whereas *capath* should
57 point to a directory of hashed certificate files. More information can 57 point to a directory of hashed certificate files. More information can
58 be found in :meth:`ssl.SSLContext.load_verify_locations`. 58 be found in :meth:`ssl.SSLContext.load_verify_locations`.
59 59
60 The *cadefault* parameter specifies whether to fall back to loading a 60 The *cadefault* parameter specifies whether to fall back to loading a
61 default certificate store defined by the underlying OpenSSL library if the 61 default certificate store defined by the underlying OpenSSL library if the
62 *cafile* and *capath* parameters are omitted. This will only work on 62 *cafile* and *capath* parameters are omitted. This will only work on
63 some non-Windows platforms. 63 some non-Windows platforms.
64
65 .. warning::
AntoinePitrou 2014/10/30 20:06:39 Add a "versionchanged" for the change in behaviour
66 If neither *cafile* nor *capath* is specified, and *cadefault* is ``False` `,
67 an HTTPS request will not do any verification of the server's
68 certificate.
69 64
70 For http and https urls, this function returns a 65 For http and https urls, this function returns a
71 :class:`http.client.HTTPResponse` object which has the following 66 :class:`http.client.HTTPResponse` object which has the following
72 :ref:`httpresponse-objects` methods. 67 :ref:`httpresponse-objects` methods.
73 68
74 For ftp, file, and data urls and requests explicitly handled by legacy 69 For ftp, file, and data urls and requests explicitly handled by legacy
75 :class:`URLopener` and :class:`FancyURLopener` classes, this function 70 :class:`URLopener` and :class:`FancyURLopener` classes, this function
76 returns a :class:`urllib.response.addinfourl` object which can work as 71 returns a :class:`urllib.response.addinfourl` object which can work as
77 :term:`context manager` and has methods such as 72 :term:`context manager` and has methods such as
78 73
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 .. module:: urllib.response 1444 .. module:: urllib.response
1450 :synopsis: Response classes used by urllib. 1445 :synopsis: Response classes used by urllib.
1451 1446
1452 The :mod:`urllib.response` module defines functions and classes which define a 1447 The :mod:`urllib.response` module defines functions and classes which define a
1453 minimal file like interface, including ``read()`` and ``readline()``. The 1448 minimal file like interface, including ``read()`` and ``readline()``. The
1454 typical response object is an addinfourl instance, which defines an ``info()`` 1449 typical response object is an addinfourl instance, which defines an ``info()``
1455 method and that returns headers and a ``geturl()`` method that returns the url. 1450 method and that returns headers and a ``geturl()`` method that returns the url.
1456 Functions defined by this module are used internally by the 1451 Functions defined by this module are used internally by the
1457 :mod:`urllib.request` module. 1452 :mod:`urllib.request` module.
1458 1453
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+