diff options
-rw-r--r-- | ext/openssl/xp_ssl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index a2406fb572..b0f6d4deca 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -891,7 +891,13 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is return NULL; #endif } else if (method_value == STREAM_CRYPTO_METHOD_SSLv3) { +#ifndef OPENSSL_NO_SSL3 return is_client ? SSLv3_client_method() : SSLv3_server_method(); +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "SSLv3 support is not compiled into the OpenSSL library PHP is linked against"); + return NULL; +#endif } else if (method_value == STREAM_CRYPTO_METHOD_TLSv1_0) { return is_client ? TLSv1_client_method() : TLSv1_server_method(); } else if (method_value == STREAM_CRYPTO_METHOD_TLSv1_1) { @@ -2262,8 +2268,13 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen, sslsock->method = STREAM_CRYPTO_METHOD_SSLv2_CLIENT; #endif } else if (strncmp(proto, "sslv3", protolen) == 0) { +#ifdef OPENSSL_NO_SSL3 + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against"); + return NULL; +#else sslsock->enable_on_connect = 1; sslsock->method = STREAM_CRYPTO_METHOD_SSLv3_CLIENT; +#endif } else if (strncmp(proto, "tls", protolen) == 0) { sslsock->enable_on_connect = 1; sslsock->method = get_crypto_method(context, STREAM_CRYPTO_METHOD_TLS_CLIENT); |