File php5-openssl.patch of Package php

--- ext/openssl/openssl.c.orig
+++ ext/openssl/openssl.c
@@ -47,6 +47,7 @@
 #include <openssl/rand.h>
 #include <openssl/ssl.h>
 #include <openssl/pkcs12.h>
+#include <openssl/engine.h>
 
 /* Common */
 #include <time.h>
@@ -979,10 +980,16 @@ PHP_MINIT_FUNCTION(openssl)
 	le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number);
 	le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "OpenSSL X.509 CSR", module_number);
 
+    OPENSSL_config(NULL);
 	SSL_library_init();
 	OpenSSL_add_all_ciphers();
 	OpenSSL_add_all_digests();
 	OpenSSL_add_all_algorithms();
+/* Load all bundled ENGINEs into memory and make them visible */
+    ENGINE_load_builtin_engines();
+ /* Register all of them for every algorithm they collectively implement */
+    ENGINE_register_all_complete();
+
 
 	ERR_load_ERR_strings();
 	ERR_load_crypto_strings();
--- ext/openssl/xp_ssl.c.orig
+++ ext/openssl/xp_ssl.c
@@ -376,7 +376,9 @@ static inline int php_openssl_setup_cryp
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL context");
 		return -1;
 	}
-
+#ifdef SSL_MODE_RELEASE_BUFFERS
+    SSL_CTX_set_mode(sslsock->ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
 	SSL_CTX_set_options(sslsock->ctx, SSL_OP_ALL);
 
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL