Ignore:
Timestamp:
Jun 27, 2020, 10:49:03 AM (15 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master
Children:
19fbd4d
Parents:
add6b31
Message:

Fix SNI/ServerAlias matching

ServerAliases? were never checked if ServerName? was set, which is
obviously wrong, and the test did not verify if the correct virtual
host had been selected. Fix this by checking ServerName?, explicit
ServerAliases?, and wildcard ServerAliases? in order, and returning the
first match. Also the test now verifies the selected virtual host and
tests a wildcard match in addition to an explicit ServerAlias?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/tests/31_vhost_SNI_serveralias_match/apache.conf

    radd6b31 re63515a  
    22
    33GnuTLSCache ${DEFAULT_CACHE}
     4
     5LoadModule      rewrite_module  ${AP_LIBEXECDIR}/mod_rewrite.so
    46
    57<VirtualHost _default_:${TEST_PORT}>
     
    1214<VirtualHost _default_:${TEST_PORT}>
    1315        ServerName      ${TEST_HOST}
     16        ServerAlias     test.example.com
    1417        ServerAlias     *.virtual.host
    1518        GnuTLSEnable    On
    1619        GnuTLSCertificateFile   authority/server/x509.pem
    1720        GnuTLSKeyFile           authority/server/secret.key
     21        # Use mod_rewrite to set up a path that will work only on this
     22        # virtual host
     23        RewriteEngine   On
     24        RewriteRule     "^/vhost/test\.txt$" "/test.txt" [PT]
    1825</VirtualHost>
Note: See TracChangeset for help on using the changeset viewer.