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

前端 未结 1 1379
予麋鹿
予麋鹿 2021-01-21 00:57

I\'m trying to figure out how to use let\'s encrypt with my rails app on heroku.

I\'ve tried several gems which appear to have been designed to help with this process (l

相关标签:
1条回答
  • 2021-01-21 01:28

    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

    0 讨论(0)
提交回复
热议问题