]> granicus.if.org Git - apache/commitdiff
proxy needs to use client ssl method
authorDoug MacEachern <dougm@apache.org>
Fri, 29 Mar 2002 02:06:57 +0000 (02:06 +0000)
committerDoug MacEachern <dougm@apache.org>
Fri, 29 Mar 2002 02:06:57 +0000 (02:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94282 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_init.c

index c57540f86f65c785e6ed6645284772a3fb59d0c1..87da1f4e6340ea5e4b32c5e624c037b109cc3b1e 100644 (file)
@@ -407,6 +407,7 @@ static void ssl_init_ctx(server_rec *s,
                          modssl_ctx_t *mctx)
 {
     SSL_CTX *ctx = NULL;
+    SSL_METHOD *method = NULL;
     char *cp;
     int protocol = mctx->protocol;
 
@@ -430,10 +431,16 @@ static void ssl_init_ctx(server_rec *s,
             "Creating new SSL context (protocols: %s)", cp);
 
     if (protocol == SSL_PROTOCOL_SSLV2) {
-        ctx = SSL_CTX_new(SSLv2_server_method());  /* only SSLv2 is left */
+        method = mctx->pkp ?
+            SSLv2_client_method() : /* proxy */
+            SSLv2_server_method();  /* server */
+        ctx = SSL_CTX_new(method);  /* only SSLv2 is left */
     }
     else {
-        ctx = SSL_CTX_new(SSLv23_server_method()); /* be more flexible */
+        method = mctx->pkp ?
+            SSLv23_client_method() : /* proxy */
+            SSLv23_server_method();  /* server */
+        ctx = SSL_CTX_new(method); /* be more flexible */
     }
 
     mctx->ssl_ctx = ctx;