Skip to content

Instantly share code, notes, and snippets.

@croaky
Last active September 14, 2018 03:53
Show Gist options
  • Save croaky/e0beb6025d58eeb88db5 to your computer and use it in GitHub Desktop.
Save croaky/e0beb6025d58eeb88db5 to your computer and use it in GitHub Desktop.

SSL certificates can be intimidating but Heroku and DNSimple make the process easy. The following steps should take you less than 15 minutes.

Buy the SSL certification from DNSimple

Buy a wildcard certificate from DNSimple. The wildcard (*) lets you use the same certificate on staging, production, and any other future subdomains (api, etc.).

Prepare the SSL certificate

Follow these instructions to download the private.key from DNSimple's website, get the server.crt from DNSimple via email, and generate the bundle.pem Comodo bundle.

Provision the SSL endpoint from Heroku

Follow these instructions to provision the SSL endpoint add-on.

Add Heroku SSL endpoint to DNSimple

Follow these instructions to add the Heroku SSL endpoint to DNSimple.

Prepare Rails app

Make a one-line configuration change in your staging and production environment config files within your Rails app:

# config/environments/{staging,production}.rb
config.force_ssl = true

Deploy that change.

Now, if users type "yourdomain.com", they should be redirected to "https://www.yourdomain.com" and your browser's URL bar should display its appropriate indicator (perhaps a green lock) declaring the SSL certificate is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment