bpo-31518: Change TLS protocol for Debian (#3660) · python/cpython@aab2258

@@ -1583,7 +1583,7 @@ def test_networked_good_cert(self):

15831583

import ssl

15841584

support.requires('network')

15851585

with support.transient_internet('self-signed.pythontest.net'):

1586-

context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

1586+

context = ssl.SSLContext(ssl.PROTOCOL_TLS)

15871587

context.verify_mode = ssl.CERT_REQUIRED

15881588

context.load_verify_locations(CERT_selfsigned_pythontestdotnet)

15891589

h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context)

@@ -1599,7 +1599,7 @@ def test_networked_bad_cert(self):

15991599

import ssl

16001600

support.requires('network')

16011601

with support.transient_internet('self-signed.pythontest.net'):

1602-

context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

1602+

context = ssl.SSLContext(ssl.PROTOCOL_TLS)

16031603

context.verify_mode = ssl.CERT_REQUIRED

16041604

context.load_verify_locations(CERT_localhost)

16051605

h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context)

@@ -1620,7 +1620,7 @@ def test_local_good_hostname(self):

16201620

# The (valid) cert validates the HTTP hostname

16211621

import ssl

16221622

server = self.make_server(CERT_localhost)

1623-

context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

1623+

context = ssl.SSLContext(ssl.PROTOCOL_TLS)

16241624

context.verify_mode = ssl.CERT_REQUIRED

16251625

context.load_verify_locations(CERT_localhost)

16261626

h = client.HTTPSConnection('localhost', server.port, context=context)

@@ -1634,7 +1634,7 @@ def test_local_bad_hostname(self):

16341634

# The (valid) cert doesn't validate the HTTP hostname

16351635

import ssl

16361636

server = self.make_server(CERT_fakehostname)

1637-

context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

1637+

context = ssl.SSLContext(ssl.PROTOCOL_TLS)

16381638

context.verify_mode = ssl.CERT_REQUIRED

16391639

context.check_hostname = True

16401640

context.load_verify_locations(CERT_fakehostname)