Rails 5, Heroku with Let's Encrypt SSL - trouble getting setup configured

你离开我真会死。 提交于 2019-12-01 22:41:20

I've recently implemented ssl on heroku (python) using one of the links that you've posted. Let me make sense of the process.

Firstly

  • Do you have your own domain name for your site or using the heroku generated domain ? All the links above are for sites with custom domain name, not for heroku default domain name[name-of-app].herokuapp.com
  • To have your own domain name follow the procedure described here
  • One you have your custom domain name setup follow the above link with example.com replaced with --your-domain--name.com

I'll be happy to explain more once you have done the above process

Now that you have a site which you can access at myexample.com which is hosted on heroku

  • You have to open a url with route .well-known/acme-challenge on your rails app. Once you open it and redeploy your rails app you should be able to go to the URL http://myexample.com/.well-known/acme-challenge For now this will display a blank page with no content.
  • Next go through the manual generation of the ssl certificates specified in the above link with your domain name entered. You should reach a step where you were given a long randomised token ya6k1edW38z.ebThgg67ggbb...

Now here is the critical part. This is how let's encrypt verifies that you are the actual owner of the domain for which you are generating ssl certificates. It gives you a really random and complex text and asks you to display on a particular route .well-known/acme-challenge on the domain your-domain.com

To accomplish this

  • render this token in text format as an output for the .well-known/acme-challenge route. Refer to above link for example code
  • Redeploy your app with these changes
  • Now check manually the route http://myexample.com/.well-known/acme-challenge. This should display the text you got during manual creation in the above step.

Now proceed with the creation process on certbot. This should create the certificates for your domain. Once you got the certificates add them to heroku ssl settings following this link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!