From: Rasmus Lerdorf Date: Sun, 24 Apr 2011 20:47:22 +0000 (+0000) Subject: Support for openssl without SSLv2 supprot compiled in. Distros are starting to X-Git-Tag: php-5.4.0alpha1~191^2~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1806e67e68fdd39f5e11287f57b686b2f077560;p=php Support for openssl without SSLv2 supprot compiled in. Distros are starting to remove support now and this wasn't compiling anymore on my Debian dev box. --- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 43d8978359..efff50625f 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -329,9 +329,14 @@ static inline int php_openssl_setup_crypto(php_stream *stream, method = SSLv23_client_method(); break; case STREAM_CRYPTO_METHOD_SSLv2_CLIENT: +#ifdef OPENSSL_NO_SSL2 + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled in openSSL"); + return -1; +#else sslsock->is_client = 1; method = SSLv2_client_method(); break; +#endif case STREAM_CRYPTO_METHOD_SSLv3_CLIENT: sslsock->is_client = 1; method = SSLv3_client_method(); @@ -349,9 +354,14 @@ static inline int php_openssl_setup_crypto(php_stream *stream, method = SSLv3_server_method(); break; case STREAM_CRYPTO_METHOD_SSLv2_SERVER: +#ifdef OPENSSL_NO_SSL2 + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled in openSSL"); + return -1; +#else sslsock->is_client = 0; method = SSLv2_server_method(); break; +#endif case STREAM_CRYPTO_METHOD_TLS_SERVER: sslsock->is_client = 0; method = TLSv1_server_method();