diff options
Diffstat (limited to 'Lib/test/test_smtpnet.py')
-rw-r--r-- | Lib/test/test_smtpnet.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_smtpnet.py b/Lib/test/test_smtpnet.py index cc9bab4..b69cd9d 100644 --- a/Lib/test/test_smtpnet.py +++ b/Lib/test/test_smtpnet.py @@ -25,7 +25,9 @@ class SmtpTest(unittest.TestCase): def test_connect_starttls(self): support.get_attribute(smtplib, 'SMTP_SSL') - context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + context.check_hostname = False + context.verify_mode = ssl.CERT_NONE with support.transient_internet(self.testServer): server = smtplib.SMTP(self.testServer, self.remotePort) try: @@ -58,7 +60,9 @@ class SmtpSSLTest(unittest.TestCase): server.quit() def test_connect_using_sslcontext(self): - context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + context.check_hostname = False + context.verify_mode = ssl.CERT_NONE support.get_attribute(smtplib, 'SMTP_SSL') with support.transient_internet(self.testServer): server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) |