]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.6] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3432)
authorChristian Heimes <christian@python.org>
Thu, 7 Sep 2017 23:45:39 +0000 (16:45 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2017 23:45:39 +0000 (16:45 -0700)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 17c9ac9)

Misc/NEWS.d/next/Library/2017-09-06-19-41-01.bpo-28958.x4-K5F.rst [new file with mode: 0644]
Modules/_ssl.c

diff --git a/Misc/NEWS.d/next/Library/2017-09-06-19-41-01.bpo-28958.x4-K5F.rst b/Misc/NEWS.d/next/Library/2017-09-06-19-41-01.bpo-28958.x4-K5F.rst
new file mode 100644 (file)
index 0000000..eb4e206
--- /dev/null
@@ -0,0 +1,2 @@
+ssl.SSLContext() now uses OpenSSL error information when a context cannot be
+instantiated.
index 25fb8090f4317772c54f048535059f4c8c1f1036..ab30d212b9d136c2df93e67624561c622255fce1 100644 (file)
@@ -2643,8 +2643,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
         return NULL;
     }
     if (ctx == NULL) {
-        PyErr_SetString(PySSLErrorObject,
-                        "failed to allocate SSL context");
+        _setSSLError(NULL, 0, __FILE__, __LINE__);
         return NULL;
     }