Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f8a794c

Browse files
miss-islingtonbenjaminp
andauthoredFeb 21, 2018
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 e9edee0) Co-authored-by: Benjamin Peterson <benjamin@python.org>
1 parent 0150dc5 commit f8a794c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎Doc/library/ssl.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ to speed up repeated connections from the same clients.
16341634

16351635
import socket, ssl
16361636

1637-
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
1637+
context = ssl.SSLContext()
16381638
context.verify_mode = ssl.CERT_REQUIRED
16391639
context.check_hostname = True
16401640
context.load_default_certs()
@@ -1861,7 +1861,7 @@ If you prefer to tune security settings yourself, you might create
18611861
a context from scratch (but beware that you might not get the settings
18621862
right)::
18631863

1864-
>>> context = ssl.SSLContext(ssl.PROTOCOL_TLS)
1864+
>>> context = ssl.SSLContext()
18651865
>>> context.verify_mode = ssl.CERT_REQUIRED
18661866
>>> context.check_hostname = True
18671867
>>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")

0 commit comments

Comments
 (0)
Please sign in to comment.