summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_smtpnet.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2017-09-15 18:27:30 (GMT)
committerGitHub <noreply@github.com>2017-09-15 18:27:30 (GMT)
commita170fa162dc03f0a014373349e548954fff2e567 (patch)
treeed08062f8462d8b9e98e38b7832e39a85881b4e3 /Lib/test/test_smtpnet.py
parent4df60f18c64ba2835e68bf3eed08d8002a00f4ac (diff)
downloadcpython-a170fa162dc03f0a014373349e548954fff2e567.zip
cpython-a170fa162dc03f0a014373349e548954fff2e567.tar.gz
cpython-a170fa162dc03f0a014373349e548954fff2e567.tar.bz2
bpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)
Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER. Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/test/test_smtpnet.py')
-rw-r--r--Lib/test/test_smtpnet.py8
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)