Want to have a secure https:// url for an application you are creating? I have compiled a list of concise steps to get you there as quickly as possible. If you want more details on each step, check out the references.
Firstly create a directory where we can work.
Create an RSA private key.
Create a certificate signing request from the private key.
Hit enter for all questions, apart from when you are asked for a "common name", for this enter your application server name, or 127.0.0.1 if your server is running locally.
Now we need to create a certificate authority to sign the key.
Create a key for the certificate authority.
Create a self-signed certificate authority certificate using the key we just created.
This time when you are prompted for a "common name" enter your name.
Now we need to sign server.key with the server.crt. To do this we need a script from the latest modSSL download. Copy the script "sign.sh" to your SSL directory, and make it executable.
Then we run it against the certificate signing request.
Enter "y" for "yes" to the questions you get asked.
Create a new directory under your apache2 directory, and copy in your ca.crt, server.crt and server.key files.
Next we need to make a change to http.conf, open it up in your favourite editor.
Add the following line, under this existing line: "Listen 80"
Now we add some configuration to the Phusion Passenger preference pane config.
Add the following config at the end of the file.
Restart Apache by unchecking, then checking "Web Sharing" in the Sharing preference pane, under System Preferences. That's it, you should by able to use https:// protocol in your Rails application. Configuring your Rails app to make use of https:// effectively is the topic for another article.
Please note this tutorial is for a development server only, as there are some potential security risks as we have not set passphrase for the keys
References
Kim G
Awesome! worked perfectly on my mac :)