gboudreau / certbot-heroku

Let's Encrypt (certbot) plugin for Heroku apps
Other
44 stars 12 forks source link

Env var is set but challenge fails #6

Open bee-keeper opened 7 years ago

bee-keeper commented 7 years ago

Hi there,

Thanks for this plugin, not sure why yet but I haven't been able to get it to work and I'm curious to how you're using the envvar in conjunction with url config.

I have the following setup in urls.py. The URL resolves but it never takes the env var even though I can see that it has been set. I have also tried to pick it up in settings.py but with similar results.

url(r'^.well-known/acme-challenge/[-\w]+$', lambda request: HttpResponse( os.getenv('LETS_ENCRYPT_CHALLENGE', ''), content_type="text/plain") ),

gboudreau commented 7 years ago

I know nothing about the Python framework you are using (is it Django?)

Did you check the examples in the server folder? There is one for Django specifically, which includes a sampleurl() definition in urls.py That seems to define what method is called to answer requests matching the defined URL pattern, which is the letsencrypt_challenge_response method defined in views.py in the sample.

bee-keeper commented 7 years ago

Hi, thanks for the reply.

Yep it's Django, I didn't see you had an examples directory actually but looks like I set it up the same way regardless. Let me try get back with something more useful when i get a chance.