]> granicus.if.org Git - python/commitdiff
[2.7] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3433)
authorChristian Heimes <christian@python.org>
Thu, 7 Sep 2017 23:45:07 +0000 (16:45 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2017 23:45:07 +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 761554a7827f4eaa8eefbd2286ade80aa1087b72..5b4cec203addf68df154c439376f7c06a7da23e9 100644 (file)
@@ -2146,8 +2146,7 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
         return NULL;
     }
     if (ctx == NULL) {
-        PyErr_SetString(PySSLErrorObject,
-                        "failed to allocate SSL context");
+        _setSSLError(NULL, 0, __FILE__, __LINE__);
         return NULL;
     }