From: Christian Heimes Date: Thu, 7 Sep 2017 21:14:00 +0000 (-0700) Subject: bpo-28958: Improve SSLContext error reporting. (#3414) X-Git-Tag: v3.7.0a1~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17c9ac927b97472dd080174fde709d9234848195;p=python bpo-28958: Improve SSLContext error reporting. (#3414) Signed-off-by: Christian Heimes --- 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 index 0000000000..eb4e206be3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-09-06-19-41-01.bpo-28958.x4-K5F.rst @@ -0,0 +1,2 @@ +ssl.SSLContext() now uses OpenSSL error information when a context cannot be +instantiated. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index b8509acc3f..5ea354a60a 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -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; }