]> granicus.if.org Git - php/commitdiff
Support for openssl without SSLv2 supprot compiled in. Distros are starting to
authorRasmus Lerdorf <rasmus@php.net>
Sun, 24 Apr 2011 20:47:22 +0000 (20:47 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Sun, 24 Apr 2011 20:47:22 +0000 (20:47 +0000)
remove support now and this wasn't compiling anymore on my Debian dev box.

ext/openssl/xp_ssl.c

index 43d89783598498b40086010c04de2954159aeb6d..efff50625f01e173d03cec32be42d144547d7ee6 100644 (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();