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

Delta Between Two Patch Sets: Doc/library/urllib.request.rst

Issue 22417: PEP 476: verify HTTPS certificates by default
Left Patch Set: Created 4 years, 8 months ago
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Doc/library/http.client.rst ('k') | Doc/library/xmlrpc.client.rst » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 30 matching lines...) Expand all
41 41
42 urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header 42 urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header
43 in its HTTP requests. 43 in its HTTP requests.
44 44
45 The optional *timeout* parameter specifies a timeout in seconds for 45 The optional *timeout* parameter specifies a timeout in seconds for
46 blocking operations like the connection attempt (if not specified, 46 blocking operations like the connection attempt (if not specified,
47 the global default timeout setting will be used). This actually 47 the global default timeout setting will be used). This actually
48 only works for HTTP, HTTPS and FTP connections. 48 only works for HTTP, HTTPS and FTP connections.
49 49
50 If *context* is specified, it must be a :class:`ssl.SSLContext` instance 50 If *context* is specified, it must be a :class:`ssl.SSLContext` instance
51 describing the various SSL options. See 51 describing the various SSL options. See :class:`~http.client.HTTPSConnection`
52 :class:`~http.client.HTTPSConnection` for more details. 52 for more details.
53 53
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
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 .. versionchanged:: 3.2 103 .. versionchanged:: 3.2
104 HTTPS virtual hosts are now supported if possible (that is, if 104 HTTPS virtual hosts are now supported if possible (that is, if
105 :data:`ssl.HAS_SNI` is true). 105 :data:`ssl.HAS_SNI` is true).
106 106
107 .. versionadded:: 3.2 107 .. versionadded:: 3.2
108 *data* can be an iterable object. 108 *data* can be an iterable object.
109 109
110 .. versionchanged:: 3.3 110 .. versionchanged:: 3.3
111 *cadefault* was added. 111 *cadefault* was added.
112 112
113 .. versionchanged:: 3.5 113 .. versionchanged:: 3.4.3
114 *context* was added. 114 *context* was added, and this function now performs all the necessary cert ificate and hostname checks by default for *https* URLS.
115
115 116
116 .. function:: install_opener(opener) 117 .. function:: install_opener(opener)
117 118
118 Install an :class:`OpenerDirector` instance as the default global opener. 119 Install an :class:`OpenerDirector` instance as the default global opener.
119 Installing an opener is only necessary if you want urlopen to use that 120 Installing an opener is only necessary if you want urlopen to use that
120 opener; otherwise, simply call :meth:`OpenerDirector.open` instead of 121 opener; otherwise, simply call :meth:`OpenerDirector.open` instead of
121 :func:`~urllib.request.urlopen`. The code does not check for a real 122 :func:`~urllib.request.urlopen`. The code does not check for a real
122 :class:`OpenerDirector`, and any class with the appropriate interface will 123 :class:`OpenerDirector`, and any class with the appropriate interface will
123 work. 124 work.
124 125
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 .. module:: urllib.response 1445 .. module:: urllib.response
1445 :synopsis: Response classes used by urllib. 1446 :synopsis: Response classes used by urllib.
1446 1447
1447 The :mod:`urllib.response` module defines functions and classes which define a 1448 The :mod:`urllib.response` module defines functions and classes which define a
1448 minimal file like interface, including ``read()`` and ``readline()``. The 1449 minimal file like interface, including ``read()`` and ``readline()``. The
1449 typical response object is an addinfourl instance, which defines an ``info()`` 1450 typical response object is an addinfourl instance, which defines an ``info()``
1450 method and that returns headers and a ``geturl()`` method that returns the url. 1451 method and that returns headers and a ``geturl()`` method that returns the url.
1451 Functions defined by this module are used internally by the 1452 Functions defined by this module are used internally by the
1452 :mod:`urllib.request` module. 1453 :mod:`urllib.request` module.
1453 1454
LEFTRIGHT

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