summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-02-21 06:07:17 (GMT)
committerGitHub <noreply@github.com>2018-02-21 06:07:17 (GMT)
commitf8a794c04c8d375da279fc830770a5e6b4f363fb (patch)
treea60bf8369333bda32476d785f6aa56f8cc345a02 /Doc/library
parent0150dc589439a9a78c80c2aa8d7d6c5d3bba1d6d (diff)
downloadcpython-f8a794c04c8d375da279fc830770a5e6b4f363fb.zip
cpython-f8a794c04c8d375da279fc830770a5e6b4f363fb.tar.gz
cpython-f8a794c04c8d375da279fc830770a5e6b4f363fb.tar.bz2
bpo-32008: don't use PROTOCOL_TLSv1 in example (GH-5789)
It's bad form to pin to an old version of TLS. ssl.SSLContext has the right protocol default, so let's not pass anyway. (cherry picked from commit e9edee0b65650c4f9db90cefc2e9a8125bad762c) Co-authored-by: Benjamin Peterson <benjamin@python.org>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/ssl.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 8f219c5..1c9e597 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -1634,7 +1634,7 @@ to speed up repeated connections from the same clients.
import socket, ssl
- context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ context = ssl.SSLContext()
context.verify_mode = ssl.CERT_REQUIRED
context.check_hostname = True
context.load_default_certs()
@@ -1861,7 +1861,7 @@ If you prefer to tune security settings yourself, you might create
a context from scratch (but beware that you might not get the settings
right)::
- >>> context = ssl.SSLContext(ssl.PROTOCOL_TLS)
+ >>> context = ssl.SSLContext()
>>> context.verify_mode = ssl.CERT_REQUIRED
>>> context.check_hostname = True
>>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")