41a6c3
diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
41a6c3
index 15993f1..53ed6f1 100644
41a6c3
--- a/modules/ssl/ssl_engine_config.c
41a6c3
+++ b/modules/ssl/ssl_engine_config.c
41a6c3
@@ -55,6 +55,7 @@ SSLModConfigRec *ssl_config_global_create(server_rec *s)
41a6c3
     mc = (SSLModConfigRec *)apr_palloc(pool, sizeof(*mc));
41a6c3
     mc->pPool = pool;
41a6c3
     mc->bFixed = FALSE;
41a6c3
+    mc->sni_required = FALSE;
41a6c3
 
41a6c3
     /*
41a6c3
      * initialize per-module configuration
41a6c3
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
41a6c3
index bf1f0e4..a7523de 100644
41a6c3
--- a/modules/ssl/ssl_engine_init.c
41a6c3
+++ b/modules/ssl/ssl_engine_init.c
41a6c3
@@ -409,7 +409,7 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
41a6c3
     /*
41a6c3
      * Configuration consistency checks
41a6c3
      */
41a6c3
-    ssl_init_CheckServers(base_server, ptemp);
41a6c3
+    ssl_init_CheckServers(mc, base_server, ptemp);
41a6c3
 
41a6c3
     /*
41a6c3
      *  Announce mod_ssl and SSL library in HTTP Server field
41a6c3
@@ -1475,7 +1475,7 @@ void ssl_init_ConfigureServer(server_rec *s,
41a6c3
     }
41a6c3
 }
41a6c3
 
41a6c3
-void ssl_init_CheckServers(server_rec *base_server, apr_pool_t *p)
41a6c3
+void ssl_init_CheckServers(SSLModConfigRec *mc, server_rec *base_server, apr_pool_t *p)
41a6c3
 {
41a6c3
     server_rec *s, *ps;
41a6c3
     SSLSrvConfigRec *sc;
41a6c3
@@ -1557,6 +1557,7 @@ void ssl_init_CheckServers(server_rec *base_server, apr_pool_t *p)
41a6c3
     }
41a6c3
 
41a6c3
     if (conflict) {
41a6c3
+        mc->sni_required = TRUE;
41a6c3
 #ifdef OPENSSL_NO_TLSEXT
41a6c3
         ap_log_error(APLOG_MARK, APLOG_WARNING, 0, base_server, APLOGNO(01917)
41a6c3
                      "Init: You should not use name-based "
41a6c3
diff --git a/modules/ssl/ssl_engine_kernel.c b/modules/ssl/ssl_engine_kernel.c
41a6c3
index bc9e26b..2460f01 100644
41a6c3
--- a/modules/ssl/ssl_engine_kernel.c
41a6c3
+++ b/modules/ssl/ssl_engine_kernel.c
41a6c3
@@ -164,6 +164,7 @@ int ssl_hook_ReadReq(request_rec *r)
41a6c3
         return DECLINED;
41a6c3
     }
41a6c3
 #ifndef OPENSSL_NO_TLSEXT
41a6c3
+    if (myModConfig(r->server)->sni_required) {
41a6c3
     if ((servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name))) {
41a6c3
         char *host, *scope_id;
41a6c3
         apr_port_t port;
41a6c3
@@ -206,6 +207,7 @@ int ssl_hook_ReadReq(request_rec *r)
41a6c3
                      " virtual host");
41a6c3
         return HTTP_FORBIDDEN;
41a6c3
     }
41a6c3
+    }
41a6c3
 #endif
41a6c3
     SSL_set_app_data2(ssl, r);
41a6c3
 
41a6c3
diff --git a/modules/ssl/ssl_private.h b/modules/ssl/ssl_private.h
41a6c3
index 75fc0e3..31dbfa9 100644
41a6c3
--- a/modules/ssl/ssl_private.h
41a6c3
+++ b/modules/ssl/ssl_private.h
41a6c3
@@ -554,6 +554,7 @@ typedef struct {
41a6c3
     struct {
41a6c3
         void *pV1, *pV2, *pV3, *pV4, *pV5, *pV6, *pV7, *pV8, *pV9, *pV10;
41a6c3
     } rCtx;
41a6c3
+    BOOL            sni_required;
41a6c3
 } SSLModConfigRec;
41a6c3
 
41a6c3
 /** Structure representing configured filenames for certs and keys for
41a6c3
@@ -786,7 +787,7 @@ const char *ssl_cmd_SSLFIPS(cmd_parms *cmd, void *dcfg, int flag);
41a6c3
 int          ssl_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *);
41a6c3
 void         ssl_init_Engine(server_rec *, apr_pool_t *);
41a6c3
 void         ssl_init_ConfigureServer(server_rec *, apr_pool_t *, apr_pool_t *, SSLSrvConfigRec *);
41a6c3
-void         ssl_init_CheckServers(server_rec *, apr_pool_t *);
41a6c3
+void         ssl_init_CheckServers(SSLModConfigRec *mc, server_rec *, apr_pool_t *);
41a6c3
 STACK_OF(X509_NAME)
41a6c3
             *ssl_init_FindCAList(server_rec *, apr_pool_t *, const char *, const char *);
41a6c3
 void         ssl_init_Child(apr_pool_t *, server_rec *);