Skip to content

Commit 197a5b9

Browse files
Revert "Don't return SSL_ERROR_SYSCALL for EOF"
This reverts commit d54629b.
1 parent 4835c9c commit 197a5b9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ssl/ssl_lib.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,14 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
13821382
return SSL_ERROR_SSL;
13831383
}
13841384

1385-
if (ret_code == 0 && ssl->s3->rwstate == SSL_ERROR_ZERO_RETURN) {
1386-
return SSL_ERROR_ZERO_RETURN;
1385+
if (ret_code == 0) {
1386+
if (ssl->s3->rwstate == SSL_ERROR_ZERO_RETURN) {
1387+
return SSL_ERROR_ZERO_RETURN;
1388+
}
1389+
// An EOF was observed which violates the protocol, and the underlying
1390+
// transport does not participate in the error queue. Bubble up to the
1391+
// caller.
1392+
return SSL_ERROR_SYSCALL;
13871393
}
13881394

13891395
switch (ssl->s3->rwstate) {

0 commit comments

Comments
 (0)