Fix bug #79589: ssl3_read_n:unexpected eof while reading · php/php-src@74f75db · GitHub
Skip to content

Commit 74f75db

Browse files
committed
Fix bug #79589: ssl3_read_n:unexpected eof while reading
The unexpected EOF failure was introduced in OpenSSL 3.0 to prevent truncation attack. However there are many non complaint servers and it is causing break for many users including potential majority of those where the truncation attack is not applicable. For that reason we try to keep behavior consitent with older OpenSSL versions which is also the path chosen by some other languages and web servers. Closes GH-8369
1 parent 49549ea commit 74f75db

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

NEWS

Lines changed: 4 additions & 0 deletions

ext/openssl/tests/bug79589.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Bug #65538: TLS unexpected EOF failure
3+
--EXTENSIONS--
4+
openssl
5+
--SKIPIF--
6+
<?php
7+
if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
8+
?>
9+
--FILE--
10+
<?php
11+
12+
$release = file_get_contents(
13+
'https://chromedriver.storage.googleapis.com/LATEST_RELEASE',
14+
false,
15+
stream_context_create(['ssl' => ['verify_peer'=> false]])
16+
);
17+
echo gettype($release);
18+
19+
?>
20+
--EXPECT--
21+
string

ext/openssl/xp_ssl.c

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)