Jump to content

SSL Issue


benanamen

Recommended Posts

I just set up SSL on Apache that has one IP and two domains that are using SSL. Individually they both work as expected. If they are both using port 443 at the same time, the server is defaulting to the first domain I set up which creates a domain mismatch error on the second one since it is reading the cert from the first domain.

 

I have always had one IP per domain so I have never run across this problem. Doing research on it as I post. Anyone know the fix?

Link to comment
Share on other sites


NameVirtualHost *:443

<VirtualHost *:443>
DocumentRoot "/docrootpath"
ServerName domain1
ServerAdmin webmaster@localhost
ErrorLog /path
CustomLog /path
<Directory "path">
allow from all
AllowOverride All
Options None
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /path
SSLCertificateKeyFile /path
SSLCACertificateFile /path
<Directory "/path">
allow from all
Options None
Require all granted
</Directory>
</VirtualHost>



<VirtualHost *:443>
DocumentRoot "/path"
ServerName domain2
ServerAdmin webmaster@localhost
ErrorLog /path
CustomLog /path
<Directory "/path">
Order Allow,Deny
Allow from all
AllowOverride all
Options None
Require all granted
</Directory>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]
<Directory "/path">
allow from all
Options None
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /path
SSLCertificateKeyFile /path
SSLCACertificateFile /path
</VirtualHost>
Link to comment
Share on other sites

Seems fine. Maybe there's something more obvious wrong? Sure you have the right domain names? Are you being redirected at any point? Does the mismatch error truly say the certificate is for the other domain?

What if you swap the virtualhosts in the configuration file? Does it have the same problem but in reverse?

 

And what if you include a

SSLStrictSNIVHostCheck on
in the configuration (outside a vhost)?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.