summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-08-03 14:09:29 (GMT)
committerGitHub <noreply@github.com>2023-08-03 14:09:29 (GMT)
commit93fcf7587888e93ff7e45f4422c315f8a5f1ba0d (patch)
treeea552d70744124c50e42f586307e89c279949f6c /Modules
parent12d1c494ae236e1a1ce8ae8084f8f9a6b6eb8295 (diff)
downloadcpython-93fcf7587888e93ff7e45f4422c315f8a5f1ba0d.zip
cpython-93fcf7587888e93ff7e45f4422c315f8a5f1ba0d.tar.gz
cpython-93fcf7587888e93ff7e45f4422c315f8a5f1ba0d.tar.bz2
[3.12] gh-107077: Raise SSLCertVerificationError even if the error is set via SSL_ERROR_SYSCALL (GH-107586) (#107587)
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 619b4f4..e939f95 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -647,6 +647,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;