Determine if SSL certificate supports wildcard subdomains?

Solution 1:

the ssl certificate is tied into a domain name - so simply inspect the certificate and if the domain listed is *.domain.com then it is a wildcard - if the domain is domain.com then it is specific to that domain.

Solution 2:

This can be done by checking for the common name in the SSL's subject. You can use the bash command openssl on *NIX clients.

For instance, google.com and www.google.com use two different SSLs. The first is a wildcard, the second is domain specific.

$ echo | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 -noout -subject | grep -o "CN=.*" | cut -c 4-
*.google.com
$ echo | openssl s_client -connect www.google.com:443 2>/dev/null | openssl x509 -noout -subject | grep -o "CN=.*" | cut -c 4-
www.google.com