1 diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
2 index 5564bf6f08..423f696c76 100644
3 --- a/ext/openssl/xp_ssl.c
4 +++ b/ext/openssl/xp_ssl.c
5 @@ -1349,6 +1349,10 @@ static int php_openssl_set_server_specif
7 long ssl_ctx_options = SSL_CTX_get_options(ctx);
9 +#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
10 + ssl_ctx_options |= SSL_OP_IGNORE_UNEXPECTED_EOF;
13 #if defined(HAVE_ECDH) && PHP_OPENSSL_API_VERSION < 0x10100
14 if (php_openssl_set_server_ecdh_curve(stream, ctx) == FAILURE) {
16 @@ -1686,6 +1690,10 @@ int php_openssl_setup_crypto(php_stream
17 method = sslsock->is_client ? SSLv23_client_method() : SSLv23_server_method();
18 sslsock->ctx = SSL_CTX_new(method);
20 +#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
21 + ssl_ctx_options |= SSL_OP_IGNORE_UNEXPECTED_EOF;
24 if (sslsock->ctx == NULL) {
25 php_error_docref(NULL, E_WARNING, "SSL context creation failure");