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.
This commit is contained in:
Rasmus Lerdorf 2011-04-24 20:47:22 +00:00
parent 999790a842
commit f1806e67e6

View File

@ -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();