Generate a self-signed certificate for apache2

July 16th, 2008

Sometimes I have to generate a self-signed certificate because I want to use encryption (not because I want to trust the other side, but to not have the information travel the internet in the clear). I always have to google for the solution I’m familiar with and works for me, so here it is:

openssl req -days 7300 -new -x509 -nodes -out name.pem -keyout name.key

Note that the number of days is 7300, which is about 20 years. I first had 36500 days, or 100 years, but due to the Y2K38 unix-bug, it wraps around to 1972 sigh.

Comments are closed.