Document the dangers of using verify=False
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Matt Silverlock · committed by GitHub · parent 2d39c0d · Browse files · 2 files·+19 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+19 added−1 removed
- other:+19 added−1 removed
Provenance
- Commit
02eb5a2- Tree
b093148- Author
Matt Silverlock <matt@eatsleeprepeat.net>- Committer
GitHub <noreply@github.com>- Parent
2d39c0d
2 files changed+19 added−1 removed
modified:docs/user/advanced.rst+6 added
241 unmodified lines242 243 >>> requests.get('https://kennethreitz.org', verify=False)244 <Response [200]>245 246+Note that when ``verify`` is set to ``False``, requests will accept any TLS247+certificate presented by the server, and will ignore hostname mismatches248+and/or expired certificates, which will make your application vulnerable to249+man-in-the-middle (MitM) attacks. Setting verify to ``False`` may be useful250+during local development or testing.251+252 By default, ``verify`` is set to True. Option ``verify`` only applies to host certs.253 254 Client Side Certificates255 ------------------------782 unmodified linesmodified:requests/sessions.py+13 added-1 removed
385 unmodified lines386 #: Stream response content default.387 self.stream = False388 389 #: SSL Verification default.390+ #: Defaults to `True`, requiring requests to verify the TLS certificate at the391+ #: remote end.392+ #: If verify is set to `False`, requests will accept any TLS certificate393+ #: presented by the server, and will ignore hostname mismatches and/or394+ #: expired certificates, which will make your application vulnerable to395+ #: man-in-the-middle (MitM) attacks.396+ #: Only set this to `False` for testing.397 self.verify = True398 399 #: SSL client certificate default, if String, path to ssl client400 #: cert file (.pem). If Tuple, ('cert', 'key') pair.100 unmodified lines501 :param stream: (optional) whether to immediately download the response502 content. Defaults to ``False``.503 :param verify: (optional) Either a boolean, in which case it controls whether we verify504 the server's TLS certificate, or a string, in which case it must be a path498- to a CA bundle to use. Defaults to ``True``.505+ to a CA bundle to use. Defaults to ``True``. When set to506+ ``False``, requests will accept any TLS certificate presented by507+ the server, and will ignore hostname mismatches and/or expired508+ certificates, which will make your application vulnerable to509+ man-in-the-middle (MitM) attacks. Setting verify to ``False`` 510+ may be useful during local development or testing.511 :param cert: (optional) if String, path to ssl client cert file (.pem).512 If Tuple, ('cert', 'key') pair.513 :rtype: requests.Response514 """267 unmodified lines