summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-08-03 14:09:27 (GMT)
committerGitHub <noreply@github.com>2023-08-03 14:09:27 (GMT)
commit4f65f03f2d597881e1a805e91579d10889299a3d (patch)
treead64ef590bae8302cfa7a6218280ea1ab47de40b /Modules
parent623b0d9c598585dd8917b794ae99ce89c6711c5e (diff)
downloadcpython-4f65f03f2d597881e1a805e91579d10889299a3d.zip
cpython-4f65f03f2d597881e1a805e91579d10889299a3d.tar.gz
cpython-4f65f03f2d597881e1a805e91579d10889299a3d.tar.bz2
[3.11] gh-107077: Raise SSLCertVerificationError even if the error is set via SSL_ERROR_SYSCALL (GH-107586) (#107588)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: T. Wouters <thomas@python.org>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 0925722..4ccd124 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -650,6 +650,10 @@ PySSL_SetError(PySSLSocket *sslsock, int ret, const char *filename, int lineno)
errstr = "Some I/O error occurred";
}
} else {
+ if (ERR_GET_LIB(e) == ERR_LIB_SSL &&
+ ERR_GET_REASON(e) == SSL_R_CERTIFICATE_VERIFY_FAILED) {
+ type = state->PySSLCertVerificationErrorObject;
+ }
p = PY_SSL_ERROR_SYSCALL;
}
break;