]> granicus.if.org Git - php/commitdiff
Fix build against older OpenSSL libs
authorDaniel Lowrey <rdlowrey@php.net>
Fri, 21 Feb 2014 19:16:23 +0000 (12:16 -0700)
committerDaniel Lowrey <rdlowrey@php.net>
Fri, 21 Feb 2014 20:01:04 +0000 (13:01 -0700)
ext/openssl/xp_ssl.c

index 1e2ff84cdd17f34b59b6e5c7d23fe9b1d4368541..4ee3ff65c799e5f7c3e0d98ad805e26339c449ed 100644 (file)
@@ -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;