From 9663cca135fd0f03204aba4c680e7006d4b5635b Mon Sep 17 00:00:00 2001 From: Ferdinand Niedermann Date: Tue, 14 Feb 2017 13:12:30 +0100 Subject: [PATCH] Try to fix https://github.com/pixielabs/letsencrypt-rails-heroku/issues/5 --- lib/letsencrypt-rails-heroku/letsencrypt.rb | 4 ++-- lib/tasks/letsencrypt.rake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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)