Use LetsEncrypt SSL certs with Heroku

How to use LetsEncrypt SSL certs with Heroku.

Update May 2017:

Heroku now offers free, automatic SSL certs from LetsEncrypt that are easier to manage than these are. Go Here for more information. This guide can still help if you want to run the cert process yourself.

Follow the instructions on the screen. There is a step that talks about “type in the following and verify on your website” which doesn’t really work if you are running this in manualmode (or more specifically using Heroku, which makes it interesting to try and deploy single file updates easily.) so you can skip this and just hit enter.

Once that is done, go download your newly created certs. They should be located in /etc/letsencrypt/archive/your_domain_name/. Check the folder dates on that folder to make sure you have the newest ones. I actually had 3 of them as this was my 3rd time generating certs for this domain. That folder should include a few files:

cert1.pem
chain1.pem
fullchain1.pem
privkey1.pem

Simply log into Heroku and go to settings and click on add SSL. When you get to the screen asking for the public cert, provide fullchain1.pem and click continue. It will then ask you for the private key, which is (you guessed it) privkey1.pem. Then click continue again.

Once that is done, confirm your DNS settings and finish it up. Your cert should be all good to go.