mirror of
https://github.com/python/cpython.git
synced 2026-01-04 06:22:20 +00:00
bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation (GH-18772)
[bpo-31122](): ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation Reproducer: http://tiny.cc/f4ztnz (tiny url because some bot keeps renaming b.p.o.-nnn as bpo links)
This commit is contained in:
parent
40e700ad04
commit
495bd03566
2 changed files with 6 additions and 4 deletions
|
|
@ -0,0 +1 @@
|
|||
ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation
|
||||
|
|
@ -805,10 +805,11 @@ PySSL_SetError(PySSLSocket *sslsock, int ret, const char *filename, int lineno)
|
|||
errno = err.c;
|
||||
return PyErr_SetFromErrno(PyExc_OSError);
|
||||
}
|
||||
Py_INCREF(s);
|
||||
s->errorhandler();
|
||||
Py_DECREF(s);
|
||||
return NULL;
|
||||
else {
|
||||
p = PY_SSL_ERROR_EOF;
|
||||
type = PySSLEOFErrorObject;
|
||||
errstr = "EOF occurred in violation of protocol";
|
||||
}
|
||||
} else { /* possible? */
|
||||
p = PY_SSL_ERROR_SYSCALL;
|
||||
type = PySSLSyscallErrorObject;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue