summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorGiampaolo RodolĂ  <g.rodola@gmail.com>2010-09-01 19:28:49 (GMT)
committerGiampaolo RodolĂ  <g.rodola@gmail.com>2010-09-01 19:28:49 (GMT)
commite0f9863a613b7e00794475bf4286c1dcf688ac26 (patch)
treec9f361c2b11fa7202c7ca0f30a34dac7f0a0b0b4 /Modules/_ssl.c
parentfce7fd6426519a2897330c03da7eb889232bf681 (diff)
downloadcpython-e0f9863a613b7e00794475bf4286c1dcf688ac26.zip
cpython-e0f9863a613b7e00794475bf4286c1dcf688ac26.tar.gz
cpython-e0f9863a613b7e00794475bf4286c1dcf688ac26.tar.bz2
Issue #9693 - msg 115273: attempt to fix ssl module failures on certain OpenSSL versions by calling ERR_clear_error() before raising IOError
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 0008691..7874c24 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1603,6 +1603,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
PySSL_END_ALLOW_THREADS
if (r != 1) {
if (errno != 0) {
+ ERR_clear_error();
PyErr_SetFromErrno(PyExc_IOError);
}
else {
@@ -1619,6 +1620,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
Py_XDECREF(certfile_bytes);
if (r != 1) {
if (errno != 0) {
+ ERR_clear_error();
PyErr_SetFromErrno(PyExc_IOError);
}
else {
@@ -1686,6 +1688,7 @@ load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
Py_XDECREF(capath_bytes);
if (r != 1) {
if (errno != 0) {
+ ERR_clear_error();
PyErr_SetFromErrno(PyExc_IOError);
}
else {