Rotating SSL Keys
terms :
SSL - Certificate CSR - Certificate Signing Request The CSR contains your certificate-application information, including your public key. The CSR will also create your public/private key pair used for encrypting and decrypting secure transactions.
Note: To create an SSL certificate, you must first generate and submit a Certificate Signing Request (CSR)
-
make a folder in SSL - make a heartbleed 4/11/14 folder
-
generate the host key - 'host.key'
openssl genrsa -des3 -out host.key 2048 JG1234qwer
-
generate new self-signed certificate (‘host.csr’) using the host key
openssl req -new -key host.key -out host.csr
-
answer the questions
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Nevada
Locality Name (eg, city) []:Las Vegas
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Its On Me
Organizational Unit Name (eg, section) []:*.itson.me
Common Name (e.g. server FQDN or YOUR name) []:*.itson.me
Email Address []:[email protected]
Please enter the following 'extra' attributes to be sent with your certificate request
A challenge password []:
An optional company name []:
-
re-key the cert on GoDaddy
go to the SSL cert > manage certificates > choose the SSL cert > choose re-key
-
fill out the form
copy host.csr into the box choose SHA-2 click re-key
-
GoDaddy will notify you via email when the cert is re-keyed
select your server type - Nginx / or apache 2.x
download the SSL cert into the folder
received a 37846528374 folder with 37846528374.crt - new SSL certificate
gd_bundle-g2-g1.crt - contains SSL issuing certificate chain back to root SSL certificate -
generate host.pem - combine SSL cert with host key
cat 37846528374.crt host.key > host.pem
-
remove pass phrase from the public key certificate and write RSA key
openssl rsa -in host.pem -out nopassphrase.pem give passphrase from step 2 openssl x509 -in host.pem >>nopassphrase.pem
-
open ‘nopassphrase.pem’ in a text editor delete the ‘private key’ section —–BEGIN RSA PRIVATE KEY—– ... —–END RSA PRIVATE KEY—–
-
generate public.pem by combining GoDaddy bundle with nopassphrase.pem
cat nopassphrase.pem gd_bundle-g2-g1.crt > public.pem
-
remove pass phrase from the private key certificate
openssl rsa -in host.key -out private.key
-
move public.pem & private.key to root folder of rails app and update certs in terminal
heroku certs:update public.pem private.key -r heroku
you will be prompted to type the name of the heroku app to confirm
-
check that the website is working securely
-
remove public.pem & private.key from rails folder
Add the SSL endpoint
-
you must enable the Heroku custom domains add-on (If you haven’t done so already)
heroku addons:add custom_domains:basic
-
add ‘secure.yourdomain.com’ to Heroku’s list of domains
heroku domains:add secure.yourdomain.com
-
add Heroku’s ‘Hostname SSL’ solution
heroku addons:add ssl:hostname
https://devcenter.heroku.com/articles/ssl-endpoint < missing steps http://kenyandeveloper.wordpress.com/2012/03/11/setting-up-heroku-hostname-ssl-with-godaddy-ssl-cert/
out of date but has missing steps