sjkp / letsencrypt-azure

The easiest way to use lets encrypt certificates on Azure
110 stars 35 forks source link

System.ArgumentException: At least one name server must be configured. #4

Closed jixt closed 5 years ago

jixt commented 5 years ago

We deployed it to our Azure environment via the deployment button of this repo, but it doesn't seem to do anything. No certificate is created at all. When running the 'RequestWildcardCertificate' function we get the following error:

System.ArgumentException: At least one name server must be configured. Parameter name: nameServers at DnsClient.LookupClient..ctor(NameServer[] nameServers) at DnsClient.LookupClient..ctor(IPEndPoint[] nameServers) at DnsClient.LookupClient..ctor(IPAddress[] nameServers) at LetsEncrypt.Azure.Core.V2.DnsLookupService.GetDnsClient(String[] hostnames) in D:\a\1\s\src\LetsEncrypt.Azure.Core.V2\DnsLookupService.cs:line 61 at LetsEncrypt.Azure.Core.V2.DnsLookupService.Exists(String hostname, String dnsTxt, Int32 timeout) in D:\a\1\s\src\LetsEncrypt.Azure.Core.V2\DnsLookupService.cs:line 27 at LetsEncrypt.Azure.Core.V2.AcmeClient.RequestDnsChallengeCertificate(IAcmeDnsRequest acmeConfig) in D:\a\1\s\src\LetsEncrypt.Azure.Core.V2\AcmeClient.cs:line 57 at LetsEncrypt.Azure.Core.V2.LetsencryptService.Run(AcmeDnsRequest acmeDnsRequest, Int32 renewXNumberOfDaysBeforeExpiration) in D:\a\1\s\src\LetsEncrypt.Azure.Core.V2\LetsencryptService.cs:line 35 at LetsEncrypt.Azure.FunctionV2.Helper.InstallOrRenewCertificate(ILogger log) in D:\a\1\s\examples\LetsEncrypt.Azure.FunctionV2\Helper.cs:line 54 at LetsEncrypt.Azure.FunctionV2.RequestWildcardCertificate.Run(HttpRequest req, ILogger log) in D:\a\1\s\examples\LetsEncrypt.Azure.FunctionV2\RequestWildcardCertificate.cs:line 29

We see that the _acme-challenge dns TXT record is created, but after that, nothing happens.

Is there extra setup that needs to be done?

jixt commented 5 years ago

We found out that this only works for root domain wildcards and not for subdomain wildcards. So *.example.com would work, but *.somesubdomain.example.com would not.

This was important for us, so we forked the repository and did changes for this to work. For those interested, you can find the repository here:

https://github.com/jixt/letsencrypt-azure

sjkp commented 5 years ago

@jixt feel free to create a pull request, and I will look into merging it.