Here is a good article that explains how to create SSL certificates that are applicable to several domain names.

Unfortunately it’s in French ;) I need to look at it anyway so I’ll translate the parts I used to do that. For now, consider this port a bookmark for brain-challenged rabbits.

Otherwise, creating a self-signed certificate + key goes:

openssl req -nodes -x509 -new -out cert -pubkey