How to create an SSL certificate for more than one subdomain?

Yes, use * as common name.

This is called wildcard certs and there are large number of howtos finding with this keyword.

Here is one of them:

Update: if you want cert to match root domain as well (, then you should use Subject Alternative Name extension. When generating cert using openssh enter '*' as Common Name.

Compatibly is good enough, unless you have an ancient browser.