ohadschn / letsencrypt-webapp-renewer

[PLEASE USE FREE MS MANAGED CERTS INSTEAD] Simple WebJob-ready console application for renewing Azure Web App SSL certificates
https://www.ohadsoft.com/
Apache License 2.0
282 stars 51 forks source link

Doesn't create a certificate for the first time #39

Closed andrewgluh closed 5 years ago

andrewgluh commented 6 years ago

Web job will renew a certificate that already exists, but doesn't create a certificate for the first time like the letsencrypt extension.

This limits it's usefulness, especially for multi-tenanted apps where new domains are added on a regular basis.

ohadschn commented 6 years ago

The letsencrypt-webapp-renewer WebJob boils down to the same code as the site extension. It doesn't care whether a cert already exists or not (unless you specify renewXNumberOfDaysBeforeExpiration in which case it only checks its expiration date to see whether to run or not). When it runs, it simply creates a new cert and associates it with the appropriate Web App domains (regardless if there was a previous cert and/or association).

Indeed, in order to test this scenario I just created a blank new Web App with no cert configured, ran the letsencrypt-webapp-renewer WebJob and a new cert was configured successfully.

If this is not your experience, please share the exact steps you are taking and the full log of your WebJob run.

ohadschn commented 6 years ago

I see what's going on here, looks like the presence of renewXNumberOfDaysBeforeExpiration results in a different code path that indeed only renews. I'll see if I can work around that, I may need to ask Simon for another API in LetsEncrypt.Azure.Core (the library behind letsencrypt-siteextension).

ohadschn commented 6 years ago

Yeah, it looks like I need an API from the original site extension: https://github.com/sjkp/letsencrypt-siteextension/issues/188.

andrewgluh commented 6 years ago

Thanks for the update Ohad. Looking forward to a resolution.

ohadschn commented 5 years ago

Fixed by https://github.com/ohadschn/letsencrypt-webapp-renewer/pull/76