[3.6] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3432)

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 17c9ac9)
This commit is contained in:
Christian Heimes 2017-09-07 16:45:39 -07:00 committed by GitHub
parent fb4c28c032
commit 6c99b652f7
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1,2 @@
ssl.SSLContext() now uses OpenSSL error information when a context cannot be
instantiated.

View 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;
}