use system's CA certificates for Python 2.7.9 or higher to verify TLS connection

This commit is contained in:
Martin Zimmermann 2014-12-25 22:49:28 +01:00
parent d70eb160b9
commit f47df75422

View File

@ -64,7 +64,7 @@ class SMTP(object):
timeout=self.conf.getint('timeout'))
if self.conf.get('security') == 'starttls':
if sys.version_info >= (3, 4):
if sys.version_info >= (3, 4) or (2, 7, 9) <= sys.version_info <= (3, 0):
import ssl
self.client.starttls(context=ssl.create_default_context())
else: