Error: common name for wildcard ssl in subdomain

Posted August 16, 2021 236 views

Hello all,

I’m trying to have:
(1) * in server on apache
(2) in server on apache

both servers has SSL certificate:
(1) as wildcard certificate.
(2) as let’s encrypt certificate.

After changing the A record for server (2) to point to server, I’m facing these errors in server (1):

  1. (net::err _ cert _ common _ name _ invalid)
  2. php warning: file _ get _ contents(): peer certificate cn=`’ did not match expected

my VirtualHost configuration for server (1)

<VirtualHost *:443>
ServerAlias *
DocumentRoot /var/www/html

I’m try to have point to wordpress site in server, and all subdomain of * to server

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hey there!

Was the SSL for the apex domain and the wildcard domains issued on the same droplet? If so this will fail. You would need to point the apex domain to server 2 and generate the SSL for it on that droplet. You may also need to reissue the SSL for the wildcard subdomains on server one excluding the apex domain.

Hope it helps!