--- a/src/options.c
+++ b/src/options.c
@@ -1198,8 +1198,10 @@ static char *service_options(CMD cmd, LO
             section->client_method=(SSL_METHOD *)SSLv23_client_method();
             section->server_method=(SSL_METHOD *)SSLv23_server_method();
         } else if(!strcasecmp(arg, "SSLv2")) {
+#ifndef OPENSSL_NO_SSL2
             section->client_method=(SSL_METHOD *)SSLv2_client_method();
             section->server_method=(SSL_METHOD *)SSLv2_server_method();
+#endif
         } else if(!strcasecmp(arg, "SSLv3")) {
             section->client_method=(SSL_METHOD *)SSLv3_client_method();
             section->server_method=(SSL_METHOD *)SSLv3_server_method();
