Rss Feed Tweeter button Facebook button Technorati button Reddit button Linkedin button Webonews button Delicious button Digg button Flickr button Stumbleupon button Newsvine button

A Waage Blog

Ruby, Rails, Life

Archive for the ‘ubuntu’ Category

Quick! create a self-signed SSL certificate in Ubuntu

with 2 comments

Especially for testing SSL, I can never remember how to create a self-signed certificate. Here’s a quick and dirty guide to setting up a self-signed certificate. Obviously, not recommended for production setups :)

We will create the certificate in the “/etc/ssl/self-signed” directory

# Become root first !
$ mkdir /etc/ssl/self-signed && cd /etc/ssl/self-signed
$ openssl genrsa -des3 -out server.key 1024
$ openssl rsa -in server.key -out server.key.insecure
$ mv server.key && mv server.key.insecure server.key
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Now, you can use the files server.key and server.crt in your web server setups. See my post on Setting up Node.js with to accept HTTP and HTTPS connections for a quick example of using this SSL certificate with Node.js!

Written by Andrew Waage

February 27th, 2012 at 4:20 pm

Posted in linux, ubuntu