Ssl – How To Redirect Before Checking for SSL

apache-2.4sslssl-certificateubuntu-14.04

I have an SSL certificate for my domain, let's call it example.com.
Also I have another domain, let's call it example.net

When I get HTTPS requests for domain example.net it fails but example.com it works. I want to redirect HTTPS requests for example.net to https://example.com.

Notice: they are both hosted on the same server (Ubuntu 14.04 – Apache 2.4). I tried a CNAME record for example.net to redirect it to example.com but also fails (my browser tell's me that the certificate is vaild only for example.com).

So what to do? Do I have to get another SSL certificate for example.net?

Best Answer

If you want both sites to support HTTPS, including a mere redirect, you need both to have valid certificates.

There is no way to bypass this as it is part of the well-thought mechanism that protects the user from being led to the wrong site.

Related Topic