[ TechnoCage | Caskey | SSL ]
The following command will generate a new key and create a certificate all in one line suitable for use by Apache or any other SSL tool.
openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout www.example.com.pem -out www.example.com.pem
You can then use the file above in apache with the following two lines
SSLEngine On SSLCertificateFile www.example.com.pem
When a self-signed certificate finally expires, you may have issues with more stringent clients refusing a new self-signed certificate. This is because the serial number on your new self-signed certificate is the same as the serial on the old one *and* you probably haven't changed the host/CA identification (The State/Location/OrganizationalUnit information).
Thunderbird is one such client that reacts badly when you get a 'new' cert signed by the 'old' CA. The right solution would be for there to be a parameter under 'req -x509' to specify the serial number you want used. Since that is unavailable, I simply include the current year in the OU field, that makes it a 'different' self-signer and solves this problem.
These are rough notes waiting to be edited, use at your own risk.
Other useful notes at:
Comments welcome.

Last updated: 2004-08-29