Connecting Cloudflare to Heroku with full SSL for free -- problem with uploading certificates

Viewed 1395

I am trying to ensure that https://www.my-site.com works, or in other words, the green lock appears next to the url of my site. Right now I am getting the following error: Error 525 SSL Handshake Failed. (I have a Heroku app that is connected to my custom domain, which I have added to Cloudflare in order to get SSL.)

I checked out this page: https://help.heroku.com/GVS2BTB5/why-am-i-getting-error-525-ssl-handshake-failed-with-cloudflare-when-using-a-herokudns-com-endpoint and followed the instructions here: https://support.cloudflare.com/hc/en-us/articles/115000479507-Managing-Cloudflare-Origin-CA-certificates to obtain the origin certificate (server.crt) and private key (server.key).

Then I continued on with the instructions here: https://devcenter.heroku.com/articles/ssl and ran into more problems.

When I put in

heroku certs:add server.crt server.key

I got the following error message:

You need to be running on either Hobby or Professional dynos to be able to use SNI SSL.

I am not using paid dynos. Is it possible to have SSL with the fully free setup? Where am I getting it wrong?

1 Answers

Note: See discussion in comments. This approach may stop working after July 31st 2021.

Full SSL with free Heroku is possible via Cloudflare.

Using CNAME examplesite.com -> examplesite.herokuapp.com in Cloudflare (not the *.herokudns.com values heroku domains:add returns) worked for me:

enter image description here

SSL/TLS is set to Full. Didn't need to add certificates, it requires paid dynos. As you point out, Heroku + Cloudflare completely free SSL is good reading for anyone working with this.

Using the *.herokudns.com values in the CNAMEs caused 525 SSL Handshake Failed.

When using a custom domain (e.g. examplesite.com), make sure to also add www.examplesite.com and examplesite.com in Heroku Settings > Domains.

Related