Apache: 2 SSL certificates, same DocumentRoot


Dusty Grist

My website is configured apacheand now I'm trying to setup redirects correctly.

My website uses wildcard SSL authentication and my ssl certificate covers *.mydomain.com. My certificate provider only covers one level of subdomains. My website URL is https://level1.mydomain.com , but I want to redirect users of https://www.level1.mydomain.com to https://level1.mydomain.com . I set up a redirect from www.level1 to level1, but when I type https://www.level1.mydomain.com in my browser , I get

This server could not prove that it is www.level1.mydomain.com; its security certificate is from *.mydomain.com. This may be caused by a misconfiguration or an attacker intercepting your connection.

As I understand the reason is that www.level1 is a level2 subdomain and my wildcard doesn't cover that range.

what do I need to do? Buy other certificates from www.level1? If yes, how should I configure the virtual host so that both certificates point to the same DocumentRoot folder?

Thank you.

Michael D.

If you only enter AFAIK

www.level1.mydomain.com

Enter the browser address bar and request the mydomain.com web server on port 80 http protocol. For http you don't need a certificate.

if you enter

https://www.level1.mydomain.com

You are asking on port 443/https which requires a certificate.

If you enter

level1.mydomain.com

and only configure your webserver to work with https/443, you get an error that the webserver is not listening on port 80 (502 bad gateway - or whatever).

You need to add redirects/rewrites for all domains/virtual hosts listening on https on port 80/http. It's easy - no certificate required -

like this (untested)

<VirtualHost *:80>
   ServerName level1.mydomain.com       
   Redirect / https://level1.mydomain.com
</VirtualHost>

<VirtualHost *:80>
   ServerName  www.level1.mydomain.com
   Redirect / https://level1.mydomain.com
</VirtualHost>

Type for all users

https://www.level1.mydomain.com

You just need to buy an additional certificate for that sub.sub.domain or get a free letsencrypt.org certificate to redirect. Maybe not worth the trouble.

BTW adding a second virtual host pointing to the same DocumentRoot might work for plain HTML pages, but not for applications. I will go redirect.

Tutorial on redirect/rewrite
https://www.tecmint.com/redirect-http-to-https-on-apache/

About letsencrypt
https://letsencrypt.org/

Related


Apache ignores documentroot with multiple SSL domains

Lynxus I'm pulling my hair out here. I have Apache running two different domains using SNI to run SSL. The configuration is as follows. If I connect to console.somedomain.com it puts the user in /var/www/html/ instead of /var/www/html/somedomain/Admin/adminv4/

Apache ignores documentroot with multiple SSL domains

Lynxus I'm pulling my hair out here. I have Apache running two different domains using SNI to run SSL. The configuration is as follows. If I connect to console.somedomain.com it puts the user at /var/www/html/ instead of /var/www/html/somedomain/Admin/adminv4/

Apache ignores documentroot with multiple SSL domains

Lynxus I'm pulling my hair out here. I have Apache running two different domains using SNI to run SSL. The configuration is as follows. If I connect to console.somedomain.com it puts the user at /var/www/html/ instead of /var/www/html/somedomain/Admin/adminv4/

Apache ignores documentroot with multiple SSL domains

Lynxus I'm pulling my hair out here. I have Apache running two different domains using SNI to run SSL. The configuration is as follows. If I connect to console.somedomain.com it puts the user in /var/www/html/ instead of /var/www/html/somedomain/Admin/adminv4/

Are Java code signing certificates the same as SSL certificates?

Expect: I'm looking for a Java code signing certificate so my Java applet doesn't throw such scary security warnings. However, I found that all the places they offered were charging too much (I think) like over $200 a year. While doing research, code signing c

Are Java code signing certificates the same as SSL certificates?

Expect: I'm looking for a Java code signing certificate so my Java applet doesn't throw such scary security warnings. However, I find that all the places they offer are charging too much (I think) like over $200 a year. While doing research, code signing certi

2 twisted SSL certificates

calombo I have the following code: from twisted.web.server import Site from twisted.web.static import Data from twisted.internet import reactor, ssl root = Data("", "text/plain") site = Site(root) reactor.listenSSL(config.ws_port, site,

2 twisted SSL certificates

calombo I have the following code: from twisted.web.server import Site from twisted.web.static import Data from twisted.internet import reactor, ssl root = Data("", "text/plain") site = Site(root) reactor.listenSSL(config.ws_port, site,

2 twisted SSL certificates

calombo I have the following code: from twisted.web.server import Site from twisted.web.static import Data from twisted.internet import reactor, ssl root = Data("", "text/plain") site = Site(root) reactor.listenSSL(config.ws_port, site,

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

How to handle invalid SSL certificates with Apache HttpClient?

Rauch: I know, there are many different questions and many answers about this...but I don't get it... I have: installed ubuntu-9.10-desktop-amd64 + NetBeans6.7.1 "as is" from shutdown. Represents that I need to connect to a site via HTTPS. For this I use Apach

Ignore SSL certificates in Apache HttpClient 4.3

Jakub M .: How to ignore SSL certificate (trust all) for Apache HttpClient 4.3 ? All the answers I've found on SO treat previous versions and the API has changed. related: How to ignore SSL certificate errors in Apache HttpClient 4.0 How to handle invalid SSL

Ignore SSL certificates in Apache HttpClient 4.3

Jacob M. How to ignore SSL certificate (trust all) for Apache HttpClient 4.3 ? All the answers I've found on SO treat previous versions and the API has changed. related: How to ignore SSL certificate errors in Apache HttpClient 4.0 How to handle invalid SSL ce

How to handle invalid SSL certificates with Apache HttpClient?

Rauch: I know, there are many different questions and many answers about this...but I don't get it... I have: installed ubuntu-9.10-desktop-amd64 + NetBeans6.7.1 "as is" from shutdown. Represents that I need to connect to a site via HTTPS. For this I use Apach

Apache 2.4 messes up SSL certificates

5. Smt I have the following virtual host configuration with two SSL certificates for the domains *.example.com and *.dev.example.com: <VirtualHost *:443> ServerName site.example.com SSLEngine on SSLProxyEngine on SSLOptions +FakeBasicAuth +Exp

Ignore SSL certificates in Apache HttpClient 4.3

Jakub M .: How to ignore SSL certificate (trust all) for Apache HttpClient 4.3 ? All the answers I've found on SO treat previous versions and the API has changed. related: How to ignore SSL certificate errors in Apache HttpClient 4.0 How to handle invalid SSL

apache SSL configuration using trusted certificates

Yerox I want to know, this is my first time using SSL, is this correct. I created self signed Client-Certificates using self created CA my-own-CA.crt . When I bought the trusted CA server certificate, I got an SSL certificate with the file telesec-server.crt a

How to handle invalid SSL certificates with Apache HttpClient?

Rauch: I know, there are many different questions and many answers about this...but I don't get it... I have: installed ubuntu-9.10-desktop-amd64 + NetBeans6.7.1 "as is" from shutdown. Represents that I need to connect to a site via HTTPS. For this I use Apach