changeset: 92778:f1113c568c60 parent: 92774:67f9e757f21b parent: 92777:e1f453e13f8d user: Benjamin Peterson date: Fri Oct 03 17:33:45 2014 -0400 files: Lib/ssl.py Lib/test/test_ssl.py Misc/NEWS description: merge 3.4 (#22449) diff -r 67f9e757f21b -r f1113c568c60 Lib/ssl.py --- a/Lib/ssl.py Fri Oct 03 13:02:47 2014 -0400 +++ b/Lib/ssl.py Fri Oct 03 17:33:45 2014 -0400 @@ -379,8 +379,7 @@ if sys.platform == "win32": for storename in self._windows_cert_stores: self._load_windows_store_certs(storename, purpose) - else: - self.set_default_verify_paths() + self.set_default_verify_paths() def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None, diff -r 67f9e757f21b -r f1113c568c60 Lib/test/test_ssl.py --- a/Lib/test/test_ssl.py Fri Oct 03 13:02:47 2014 -0400 +++ b/Lib/test/test_ssl.py Fri Oct 03 17:33:45 2014 -0400 @@ -1095,6 +1095,14 @@ self.assertRaises(TypeError, ctx.load_default_certs, None) self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH') + def test_load_default_certs_env(self): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + with support.EnvironmentVarGuard() as env: + env["SSL_CERT_DIR"] = CAPATH + env["SSL_CERT_FILE"] = CERTFILE + ctx.load_default_certs() + self.assertEqual(ctx.cert_store_stats(), {"crl": 0, "x509": 1, "x509_ca": 0}) + def test_create_default_context(self): ctx = ssl.create_default_context() self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23) diff -r 67f9e757f21b -r f1113c568c60 Misc/NEWS --- a/Misc/NEWS Fri Oct 03 13:02:47 2014 -0400 +++ b/Misc/NEWS Fri Oct 03 17:33:45 2014 -0400 @@ -159,6 +159,9 @@ Library ------- +- Issue #22449: In the ssl.SSLContext.load_default_certs, consult the + enviromental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows. + - Issue #22508: The email.__version__ variable has been removed; the email code is no longer shipped separately from the stdlib, and __version__ hasn't been updated in several releases.