shibayan / appservice-acmebot

Automated ACME SSL/TLS certificates issuer for Azure App Service (Web Apps / Functions / Containers)
Apache License 2.0
392 stars 60 forks source link

HTTP-01 challenge file does not get created #270

Closed martinl88 closed 3 years ago

martinl88 commented 3 years ago

Describe the bug HTTP-01 challenge fails with this: Exception while executing function: IssueCertificate Orchestrator function 'IssueCertificate' failed: The activity function 'CheckHttpChallenge' failed: "http://domain-name-here.com/.well-known/acme-challenge/sTjMiwmRnjPJqz4R-puKojeH_LDtXtyEWQLUcVyFMBI is NotFound status code.". See the function execution logs for additional details.

Environment (please complete the following information):

Additional context I have Acmebot working on several sites just fine.. except on one. For some unknown reason, challenge files are not created in ".well-known/acme-challenge" folder (so failing with the NotFound status code is the logical outcome). The question is, why aren't the files there in the first place.

If I place a temporary file in the ".well-known/acme-challenge" folder, I can access it with the browser just fine.

I've tried to crawl through the logs but have failed to find any clue exactly what is failing and why. Can you point me in the right direction? Thanks.

shibayan commented 3 years ago

It's a strange problem. I'm trying to solve this problem.

image

martinl88 commented 3 years ago

Hi! Thank you so much for pointing me in the right direction. All that time I was analyzing the Operations log, I never thought to look at the Dependencies. From there I found out the PUT requests were getting 403 errors. After some brainstorming, we discovered that someone had put IP restrictions on the management API. That removed, certificate request went through as it should!

shibayan commented 3 years ago

Thanks for sharing the error cause. It is a problem that there is no error in advance when the management API cannot be accessed, so I will improve this as a separate issue.