]> granicus.if.org Git - python/commitdiff
bpo-28958: Improve SSLContext error reporting. (#3414)
authorChristian Heimes <christian@python.org>
Thu, 7 Sep 2017 21:14:00 +0000 (14:14 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2017 21:14:00 +0000 (14:14 -0700)
Signed-off-by: Christian Heimes <christian@python.org>
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 b8509acc3f14e6248eac4a6577713e89d0833c27..5ea354a60aacb5fe3db133cb4ed76da2151ed154 100644 (file)
@@ -2636,8 +2636,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;
     }