]> granicus.if.org Git - apache/commitdiff
COMPAT BREAK: This may change the hash keys used to cache privkeys
authorJoe Orton <jorton@apache.org>
Wed, 11 Apr 2018 16:11:21 +0000 (16:11 +0000)
committerJoe Orton <jorton@apache.org>
Wed, 11 Apr 2018 16:11:21 +0000 (16:11 +0000)
across a reload so don't backport this to 2.4.  Otherwise it's only
user-visible in logging output.

* modules/ssl/ssl_engine_init.c (ssl_init_Module): Derive the vhost_id
  *after* potentially setting sc->enabled to default-on, since the
  port used may change if not specified explicitly.

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

modules/ssl/ssl_engine_init.c

index 9dcfa42fbd1450840e248b6e036d139884bc371a..04a38da32c2d74b5f5a8c290c48e9ef00825ad83 100644 (file)
@@ -250,9 +250,6 @@ apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
             sc->server->sc = sc;
         }
 
-        /*
-         * Create the server host:port string because we need it a lot
-         */
         if (sc->vhost_id) {
             /* already set. This should only happen if this config rec is
              * shared with another server. Argh! */
@@ -260,8 +257,6 @@ apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
                          "%s, SSLSrvConfigRec shared from %s", 
                          ssl_util_vhostid(p, s), sc->vhost_id);
         }
-        sc->vhost_id = ssl_util_vhostid(p, s);
-        sc->vhost_id_len = strlen(sc->vhost_id);
 
         /* Default to enabled if SSLEngine is not set explicitly, and
          * the protocol is https. */
@@ -271,6 +266,11 @@ apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
             sc->enabled = SSL_ENABLED_TRUE;
         }
 
+        /* Derive the vhost id only after potentially defaulting-on
+         * sc->enabled since the port used may change. */
+        sc->vhost_id = ssl_util_vhostid(p, s);
+        sc->vhost_id_len = strlen(sc->vhost_id);
+        
         /* Fix up stuff that may not have been set.  If sc->enabled is
          * UNSET, then SSL is disabled on this vhost.  */
         if (sc->enabled == SSL_ENABLED_UNSET) {