Skip to content

Commit 834e32e

Browse files
committed
Merge branch 'PHP-8.1'
2 parents 926407f + 74f75db commit 834e32e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

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
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,11 @@ int php_openssl_setup_crypto(php_stream *stream,
16341634

16351635
ssl_ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
16361636

1637+
#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
1638+
/* Only for OpenSSL 3+ to keep OpenSSL 1.1.1 behavior */
1639+
ssl_ctx_options |= SSL_OP_IGNORE_UNEXPECTED_EOF;
1640+
#endif
1641+
16371642
if (!GET_VER_OPT("disable_compression") || zend_is_true(val)) {
16381643
ssl_ctx_options |= SSL_OP_NO_COMPRESSION;
16391644
}

0 commit comments

Comments
 (0)