Skip to content
Myr

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

2 files+19 added−1 removed

modified:docs/user/advanced.rst+6 added
241 unmodified lines
242243 >>> requests.get('https://kennethreitz.org', verify=False)244 <Response [200]>245246Note that when ``verify`` is set to ``False``, requests will accept any TLS247certificate presented by the server, and will ignore hostname mismatches248and/or expired certificates, which will make your application vulnerable to249man-in-the-middle (MitM) attacks. Setting verify to ``False`` may be useful250during local development or testing.251252By default, ``verify`` is set to True. Option ``verify`` only applies to host certs.253254Client Side Certificates255------------------------
782 unmodified lines
modified:requests/sessions.py+13 added-1 removed
385 unmodified lines
386 #: Stream response content default.387 self.stream = False388389 #: 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 = True398399 #: SSL client certificate default, if String, path to ssl client400 #: cert file (.pem). If Tuple, ('cert', 'key') pair.
100 unmodified lines
501 :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