Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5d38de

Browse files
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 <[email protected]>
1 parent 7452f6d commit e5d38de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/ssl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ to speed up repeated connections from the same clients.
17071707

17081708
import socket, ssl
17091709

1710-
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
1710+
context = ssl.SSLContext()
17111711
context.verify_mode = ssl.CERT_REQUIRED
17121712
context.check_hostname = True
17131713
context.load_default_certs()
@@ -1952,7 +1952,7 @@ If you prefer to tune security settings yourself, you might create
19521952
a context from scratch (but beware that you might not get the settings
19531953
right)::
19541954

1955-
>>> context = ssl.SSLContext(ssl.PROTOCOL_TLS)
1955+
>>> context = ssl.SSLContext()
19561956
>>> context.verify_mode = ssl.CERT_REQUIRED
19571957
>>> context.check_hostname = True
19581958
>>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")

0 commit comments

Comments
 (0)