[3.6] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3432) · python/cpython@6c99b65 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 6c99b65

Signed-off-by: Christian Heimes christian@python.org (cherry picked from commit 17c9ac9)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 +ssl.SSLContext() now uses OpenSSL error information when a context cannot be
2 +instantiated.
Original file line number Diff line number Diff line change
@@ -2643,8 +2643,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
2643 2643 return NULL;
2644 2644 }
2645 2645 if (ctx == NULL) {
2646 -PyErr_SetString(PySSLErrorObject,
2647 -"failed to allocate SSL context");
2646 +_setSSLError(NULL, 0, __FILE__, __LINE__);
2648 2647 return NULL;
2649 2648 }
2650 2649