How to Install Alpha SSL certificate using Moonshine for Rails 4.1

Steps


Step 1

When you generate the CSR request, do not provide pass phrase. If you provide the passphrase you can still install successfully by removing the password from the key:

openssl rsa -in /path/to/originalkeywithpass.key -out /path/to/newkeywithnopass.key

Use the newkeywithnopass.key in moonshine.yml. This is explained below.

Step 2

When you purchase your SSL certificate from Alpha SSL, you will get the following certificates:

  1. GlobalSign Root CA Certificate
  2. AlphaSSL intermediate Certificate (intermediate_domain.crt)
  3. Your domain SSL Certificate (yourdomain.com.crt)

Copy the intermediate certificate, your domain certificate and the key file to your server /home/rails/certs folder.

Step 3

Specify the values in moonshine.yml:

:ssl:
  :certificate_file: /home/rails/certs/yourdomain.com.crt
  :certificate_key_file: /home/rails/certs/yourdomain.key
  :certificate_chain_file: /home/rails/certs/intermediate_domain.crt

Step 4

Uncomment:

config.force_ssl = true

in production.rb of your Rails application.

Step 5

Check in your code and do a cap deploy. That's it.

Tip

If you have problems getting green bar for SSL connection on browsers due to some links not using https, you can find out which links are non https by using the online tool whynopadlock.com


Related Articles


Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.