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 (letsencrypt-plugin)but have removed all of the installation steps those gems recommend because I couldn't get this working.
Now, I'm back to trying to make sense of the tutorials set out here:
http://collectiveidea.com/blog/archives/2016/01/12/lets-encrypt-with-a-rails-app-on-heroku/
I'm not getting far.
I'm trying this again: https://medium.com/should-designers-code/how-to-set-up-ssl-with-lets-encrypt-on-heroku-for-free-266c185630db#.h9vjoxboq
At the moment, the error messages say:
Type: unauthorized Detail: The key authorization file from the server did not match this challenge [first random string.second random string] != [#{params[:id]}.ENV["LETS_ENCRYPT_SECOND"]] To fix these errors, please make sure that your domain name was entered correctly and the DNS A record(s) for that domain contain(s) the right IP address.
I have saved LETS_ENCRYPT_SECOND with the 'second random string' in my application.yml.
I don't have any A records in my DNS. I host on heroku - it doesnt give any A records or an IP address. My domain is registered on 123-reg.
I don't understand this part of the instructions:
mkdir -p /tmp/certbot/public_html/.well-known/acme-challenge
cd /tmp/certbot/public_html
printf "%s" first random string.second random string > .well-known/acme-challenge/first random string
run only once per server:
$(command -v python2 || command -v python2.7 || command -v python2.6) -c \ "import BaseHTTPServer, SimpleHTTPServer; \ s = BaseHTTPServer.HTTPServer(('', 80), SimpleHTTPServer.SimpleHTTPRequestHandler); \ s.serve_forever()"
I perceive them to mean that I need to put each of the above 4 commands into the terminal and then I'm done. I've done that several times but I don't get anywhere with this.
Can anyone help with advice for how to set this up. I'm stuck.
UPDATE
I have removed all the settings I created trying to follow the above guide and tried again with the letsencrypt_plugin gem
Currently, those settings are all configured but, when I try to run rake letsencrypt_plugin, I get an error that says:
Challenge verification failed! Error: urn:acme:error:unknownHost: No valid IP addresses found for www.example.com
I am now unsure whether I'm supposed to put my custom domain name in the letsencrypt_plugin.yml file, or whether I'm supposed to write the heroku app alias name for my custom domain name there.
Also, since the app is hosted on heroku, there is no IP address. My DNS configuration does not have any A records at all (no IP address).
FURTHER UPDATE
I made a completely new rails 5 app. I put it on heroku. I tried the let encrypt_plugin again. This time around, I get an error that says: