i am loading the SSL files for my wildcard subdomains from Virtualhost, but the second virtual host loads the ssl file of the first virtualhost, and the browser reports Invalid certificate error
Heres the config
<VirtualHost *:443>
ServerName cert-1.domain.com
ServerAlias cert-1.domain.com,*.net.domain.com
DocumentRoot /home/myuser/public_html
ServerAdmin webmaster@domain.com
UseCanonicalName Off
<IfModule mod_suphp.c>
suPHP_UserGroup myuser myuser
</IfModule>
<IfModule suexec_module>
<IfModule !mod_ruid2.c>
SuexecUserGroup myuser myuser
</IfModule>
</IfModule>
<IfModule ssl_module>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/cert-1.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cert-1.domain.com/privkey.pem
</IfModule>
</VirtualHost>
<VirtualHost *:443>
ServerName cert-2.domain.com
ServerAlias cert-2.domain.com,*.org.domain.com
DocumentRoot /home/myuser/public_html
ServerAdmin webmaster@domain.com
UseCanonicalName Off
<IfModule mod_suphp.c>
suPHP_UserGroup myuser myuser
</IfModule>
<IfModule suexec_module>
<IfModule !mod_ruid2.c>
SuexecUserGroup myuser myuser
</IfModule>
</IfModule>
<IfModule ssl_module>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/cert-2.domain.com-2/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cert-2.domain.com-2/privkey.pem
</IfModule>
</VirtualHost>
But when i visit anything.org.domain.com it loads the SSL file for the first virtualhost instead of that of the second Virtualhost,
Even when i tried a subdomain thats not in the first or second virtualhost, it still loads the first virtualhost SSL file, and browser throws Invalid SSL error.
How can i resolve this,
Thanks