php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #79589
Patch openssl-ignore-eof.patch revision 2022-03-29 11:55 UTC by arekm at maven dot pl

Patch openssl-ignore-eof.patch for OpenSSL related Bug #79589

Patch version 2022-03-29 11:55 UTC

Return to Bug #79589 | Download this patch
Patch Revisions:

Developer: arekm@maven.pl

diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 5564bf6f08..423f696c76 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -1286,6 +1286,10 @@ static int php_openssl_set_server_specific_opts(php_stream *stream, SSL_CTX *ctx
 	zval *zv;
 	long ssl_ctx_options = SSL_CTX_get_options(ctx);
 
+#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
+	ssl_ctx_options |= SSL_OP_IGNORE_UNEXPECTED_EOF;
+#endif
+
 #if defined(HAVE_ECDH) && PHP_OPENSSL_API_VERSION < 0x10100
 	if (php_openssl_set_server_ecdh_curve(stream, ctx) == FAILURE) {
 		return FAILURE;
@@ -1628,6 +1632,10 @@ int php_openssl_setup_crypto(php_stream *stream,
 	ssl_ctx_options = SSL_OP_ALL;
 #endif
 
+#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
+	ssl_ctx_options |= SSL_OP_IGNORE_UNEXPECTED_EOF;
+#endif
+
 	if (GET_VER_OPT("no_ticket") && zend_is_true(val)) {
 		ssl_ctx_options |= SSL_OP_NO_TICKET;
 	}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 25 16:01:31 2024 UTC