]> granicus.if.org Git - apache/commitdiff
* Do not allow name based virtual hosts in the case no hostname was
authorRuediger Pluem <rpluem@apache.org>
Tue, 24 Mar 2009 10:56:55 +0000 (10:56 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 24 Mar 2009 10:56:55 +0000 (10:56 +0000)
  provided via SNI.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757720 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_kernel.c

index 6a63e74486e9d7546c5cef04e26e7be0b8859f67..c5179f94d6e8315fe2be9eb14e615ae6ff78ffda 100644 (file)
@@ -186,6 +186,16 @@ int ssl_hook_ReadReq(request_rec *r)
             return HTTP_BAD_REQUEST;
         }
     }
+    else if (r->connection->vhost_lookup_data) {
+        /*
+         * We are using a name based configuration here, but no hostname was
+         * provided via SNI. Don't allow that.
+         */
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+                     "No hostname was provided via SNI for a name based"
+                     " virtual host");
+        return HTTP_FORBIDDEN;
+    }
 #endif
     SSL_set_app_data2(ssl, r);