-1

I'm trying to host two HTTPS sites. They are the same hostname, but different ports and different certificates. With config like this Apache starts but they both serve the certificate for the first vhost.

<VirtualHost *:443>
    ServerName idp.example.org

    SSLCertificateFile /usr/local/apache/conf/ssl/app.crt
    # ...
</VirtualHost>

<VirtualHost *:8443>
    ServerName idp.example.org

    SSLCertificateFile /usr/local/apache/conf/ssl/app.trust.crt
    # ...
</VirtualHost>

I know the SSL layer can't usually distinguish between hosts where the only difference is the hostname (since that's in the HTTP layer), but in this case the port is different so it should be fine. Is Apache being silly?

1 Answer 1

0

Apache is being silly. It sees that the hosts have the same ServerName and so uses the first matching one it finds, even though the port is different. If you remove the ServerName declaration from one or both, then Apache will serve separate certificates.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .