title: Wildcard SSL Certificate on Wildcard Subdomain in Plesk - wrong certificate served to browser
body: <p>I have a new Plesk 12 installation. I have configured a domain (example.com) with hosting that also requires wildcard subdomains.</p>
  
  <p>To achieve this I had to create a vhost.conf file with </p>
  
  <pre><code>ServerAlias *.example.com
  </code></pre>
  
  <p>This works and I can go to anything.example.com with no issue.</p>
  
  <p>I purchased a wildcard SSL certificate for *.example.com and successfully installed it.</p>
  
  <p>If I go to <a href="https://example.com" rel="nofollow">https://example.com</a>, it works perfectly and shows the correct certificate, however if I go to <a href="https://anything.example.com" rel="nofollow">https://anything.example.com</a> it tells me the connection is untrusted, when I view the certificate, it shows the Parallels Plesk self certified certificate and not my purchased certificate.</p>
  
  <p>I created a vhost_ssl.conf with</p>
  
  <pre><code>ServerAlias *.example.com
  ServerAlias *.example.com:443
  </code></pre>
  
  <p>If I add an exception, then I am taken to the correct place, albeit with the incorrect certificate.</p>
  
  <p>Of course I have executed httpdmng --reconfigure-domain example.com and also tried a full reboot.</p>
  
  <p>In summary:</p>
  
  <p><a href="http://example.com" rel="nofollow">http://example.com</a> - works</p>
  
  <p><a href="http://anything.example.com" rel="nofollow">http://anything.example.com</a> - works</p>
  
  <p><a href="https://example.com" rel="nofollow">https://example.com</a> works with my certificate</p>
  
  <p><a href="https://anything.example.com" rel="nofollow">https://anything.example.com</a> has Parallels certificate but routes to correct page</p>