Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can make a single SSL certificate for several different domain names:

But * doesn't work.

How can I make a single SSL certificate for all sub domains within

P.S. Here is the extension part of the generated certificate:

    X509v3 extensions:
        X509v3 Basic Constraints: 
        X509v3 Key Usage: 
            Digital Signature, Non Repudiation, Key Encipherment
        X509v3 Subject Alternative Name: 

It's simply not matched by any sub-domain under by the browser.

share|improve this question
what are you using to make these certs? – uSlackr Jun 7 '12 at 1:53
I'm using openssl 1.0.1c. – Xiè Jìléi Jun 7 '12 at 1:59
How does it not work? Does the certificate generation fail? Does it succeed but the client reports a name mismatch? What is the error message? – mgorven Jun 7 '12 at 3:34
Well, I can generate the certificate with * char in the domain name, but it's not matched. – Xiè Jìléi Jun 7 '12 at 4:29
That should work, but try setting * as the Common Name. – mgorven Jun 7 '12 at 5:03
up vote 0 down vote accepted

This is a bit old but I am sure this process has not changed that much over the years

mkdir /usr/share/ssl/certs/
cd /usr/share/ssl/certs/
(umask 077 && touch host.key host.cert host.pem)
openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
...[enter * for the Common Name]...
openssl x509 -noout -fingerprint -text < host.cert >
cat host.cert host.key > host.pem
chmod 400 host.key host.pem

share|improve this answer
Welcome to Server Fault! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – mgorven Jun 7 '12 at 3:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.