com php-src: Fix build against older OpenSSL libs: ext/openssl/ xp_ssl.c
| From: | rdlowrey@php.net | Date: | Fri, 21 Feb 2014 19:16:23 +0000 |
| Subject: | com php-src: Fix build against older OpenSSL libs: ext/openssl/ xp_ssl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76177@lists.php.net to get a copy of this message | ||
Commit: c3d76441d54e7a64945be938528e1bf881a568dd
Author: Daniel Lowrey <rdlowrey@php.net> Fri, 21 Feb 2014 12:16:23 -0700
Parents: 58e3fcf54f155869ccd28a8b887b157b26422cb6
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c3d76441d54e7a64945be938528e1bf881a568dd
Log:
Fix build against older OpenSSL libs
Changed paths:
M ext/openssl/xp_ssl.c
Diff:
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index c122f48..7166417 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -536,7 +536,11 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
}
}
+#if OPENSSL_VERSION_NUMBER >= 0x10001001L
sslsock->ctx = SSL_CTX_new(method);
+#else
+ sslsock->ctx = SSL_CTX_new((SSL_METHOD*)method);
+#endif
if (sslsock->ctx == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL context");
return -1;
@@ -638,8 +642,10 @@ static zval *php_capture_ssl_session_meta(SSL *ssl_handle)
const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl_handle);
switch (proto) {
+#if OPENSSL_VERSION_NUMBER >= 0x10001001L
case TLS1_2_VERSION: proto_str = "TLSv1.2"; break;
case TLS1_1_VERSION: proto_str = "TLSv1.1"; break;
+#endif
case TLS1_VERSION: proto_str = "TLSv1"; break;
case SSL3_VERSION: proto_str = "SSLv3"; break;
case SSL2_VERSION: proto_str = "SSLv2"; break;