Useful OpenSSL commands.

March 8, 2010 at 11:44 am (linux, Technology, TechTips) (, )

Often times I’ll find myself needing to do tasks with SSL certificates using OpenSSL.  I always need to look up the commands again and this takes time.  I became determined to not allow that to happen again.  This time I decided to write this quick cheat sheet of OpenSSL commands that I use often enough.  If you happen to see a command that I use here that you know of a better way to do it, please post a comment with that information for me.

Generate a private RSA key:

openssl genrsa -out host.key 1024

Generate CSR:

openssl req -new -nodes -key host.key -out host.csr
Note:  Make sure that the CN (Common Name) is the FQDN of the site that this certificate is for.

Self Signed Certificate:

openssl x509 -req -days 30 -in host.csr -signkey host.key -out host.cert

View Certificate:

openssl x509 -in filename.cert -noout -text


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: