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

Skip to content

Commit 6c7edba

Browse files
authored
[2.7] closes bpo-32008: don't use PROTOCOL_TLSv1 in example (pythonGH-5789) (python#5792)
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)
1 parent 5dc275a commit 6c7edba

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
@@ -1330,7 +1330,7 @@ to speed up repeated connections from the same clients.
13301330

13311331
import socket, ssl
13321332

1333-
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
1333+
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
13341334
context.verify_mode = ssl.CERT_REQUIRED
13351335
context.check_hostname = True
13361336
context.load_default_certs()
@@ -1536,7 +1536,7 @@ If you prefer to tune security settings yourself, you might create
15361536
a context from scratch (but beware that you might not get the settings
15371537
right)::
15381538

1539-
>>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
1539+
>>> context = ssl.SSLContext(ssl.PROTOCOL_TLS)
15401540
>>> context.verify_mode = ssl.CERT_REQUIRED
15411541
>>> context.check_hostname = True
15421542
>>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")

0 commit comments

Comments
 (0)