Skip to content

Commit 17c9ac9

Browse files
authored
bpo-28958: Improve SSLContext error reporting. (#3414)
Signed-off-by: Christian Heimes <[email protected]>
1 parent 3147b04 commit 17c9ac9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ssl.SSLContext() now uses OpenSSL error information when a context cannot be
2+
instantiated.

Modules/_ssl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,8 +2636,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
26362636
return NULL;
26372637
}
26382638
if (ctx == NULL) {
2639-
PyErr_SetString(PySSLErrorObject,
2640-
"failed to allocate SSL context");
2639+
_setSSLError(NULL, 0, __FILE__, __LINE__);
26412640
return NULL;
26422641
}
26432642

0 commit comments

Comments
 (0)