I generated a wildcard certificate using the below command:
-d *.domain1.com -d domain1.com
This works without any problem.
I have another domain hosted on the same server, domain2.com. I issued the same above command for domain2 and created another wildcard certificate without any error. But, this certificate for domain2.com doesn’t work properly.
SSLlabs check says “Certificate name mismatch. Try these other domain names (extracted from the certificates): xxx.domain1.com”
xxx.domain1.com is the hostname of the server in /etc/hosts file. It seems to me that if I need a wildcard certificate for domain2.com, I should add a hostname, yyy.domain2.com to /etc/hosts file. Is it correct way of solving this problem? Or do I need to do anthing else?
Thanks in advance.