Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0f9863

Browse files
committed
Issue #9693 - msg 115273: attempt to fix ssl module failures on certain OpenSSL versions by calling ERR_clear_error() before raising IOError
1 parent fce7fd6 commit e0f9863

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Modules/_ssl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
16031603
PySSL_END_ALLOW_THREADS
16041604
if (r != 1) {
16051605
if (errno != 0) {
1606+
ERR_clear_error();
16061607
PyErr_SetFromErrno(PyExc_IOError);
16071608
}
16081609
else {
@@ -1619,6 +1620,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
16191620
Py_XDECREF(certfile_bytes);
16201621
if (r != 1) {
16211622
if (errno != 0) {
1623+
ERR_clear_error();
16221624
PyErr_SetFromErrno(PyExc_IOError);
16231625
}
16241626
else {
@@ -1686,6 +1688,7 @@ load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
16861688
Py_XDECREF(capath_bytes);
16871689
if (r != 1) {
16881690
if (errno != 0) {
1691+
ERR_clear_error();
16891692
PyErr_SetFromErrno(PyExc_IOError);
16901693
}
16911694
else {

0 commit comments

Comments
 (0)