diff --git a/lib/letsencrypt-rails-heroku/letsencrypt.rb b/lib/letsencrypt-rails-heroku/letsencrypt.rb index 7dc4a3e..f365bad 100644 --- a/lib/letsencrypt-rails-heroku/letsencrypt.rb +++ b/lib/letsencrypt-rails-heroku/letsencrypt.rb @@ -9,14 +9,14 @@ def self.configure end def self.challenge_configured? - configuration.acme_challenge_filename && + configuration.acme_challenge_filename && configuration.acme_challenge_filename.start_with?(".well-known/") && configuration.acme_challenge_file_content end class Configuration attr_accessor :heroku_token, :heroku_app, :acme_email, :acme_domain, :acme_endpoint - + # Not settable by user; part of the gem's behaviour. attr_reader :acme_challenge_filename, :acme_challenge_file_content diff --git a/lib/tasks/letsencrypt.rake b/lib/tasks/letsencrypt.rake index 348bbf9..63e9034 100644 --- a/lib/tasks/letsencrypt.rake +++ b/lib/tasks/letsencrypt.rake @@ -51,7 +51,7 @@ namespace :letsencrypt do print "Testing filename works (to bring up app)..." # Get the domain name from Heroku - hostname = heroku.domain.list(heroku_app).first['hostname'] + hostname = domains.first open("http://#{hostname}/#{challenge.filename}").read puts "Done!" @@ -85,7 +85,7 @@ namespace :letsencrypt do certificate = client.new_certificate(csr) # => # # Send certificates to Heroku via API - + # First check for existing certificates: certificates = heroku.sni_endpoint.list(heroku_app)