diff -r 088e5d705171 Lib/test/test_smtpnet.py --- a/Lib/test/test_smtpnet.py Sat May 14 14:19:56 2011 +0200 +++ b/Lib/test/test_smtpnet.py Sat May 14 23:35:08 2011 +0530 @@ -3,12 +3,14 @@ import unittest from test import support import smtplib +import ssl support.requires("network") class SmtpSSLTest(unittest.TestCase): testServer = 'smtp.gmail.com' remotePort = 465 + context=ssl.SSLContext(ssl.PROTOCOL_SSLv23) def test_connect(self): support.get_attribute(smtplib, 'SMTP_SSL') @@ -24,6 +26,14 @@ server.ehlo() server.quit() + def test_connect_using_sslcontext(self): + support.get_attribute(smtplib, 'SMTP_SSL') + with support.transient_internet(self.testServer): + server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=self.context) + server.ehlo() + server.quit() + + def test_main(): support.run_unittest(SmtpSSLTest)