Open jiayisheji opened 3 months ago
I just delt with doing wildcards, if you log what TXT records are requested to be added, they both will be _acme-challenge.example.com
with 2 different keys to be added. Both need to be added to _acme-challenge.example.com
Are you using the sample code from https://github.com/publishlab/node-acme-client/blob/master/examples/dns-01/dns-01.js ? This works perfectly.
@wmantly I useing https://github.com/publishlab/node-acme-client/blob/master/examples/api.js.
I add useNameserversResolveDnsRecord() method,execute it first.
async useNameserversResolveDnsRecord(domain: string, nameservers: string[], logger: AcmeClientLogger) {
const originalServers = getServers();
logger.info(`[${domain}] Original Servers: ${originalServers.join(', ')}`);
setServers(nameservers);
logger.info(`[${domain}] Restart Servers: ${getServers().join(', ')}`);
return () => {
setServers(originalServers);
logger.info(`[${domain}] Restore Servers: ${getServers().join(', ')}`);
}
}
I look at the source code, you use nodejs dns module resolution, so I'm simple and rough implementation.
I need to apply for two certificates for
example.com
and*.example.com
.example.com
can pass DNS resolution authentication successfully, but*.example.com
always gets the error Authorization not found in DNS TXT record:_acme-challenge.example.com
. When I debug the code, therecordValues
array value in theverify.js#verifyDnsChallenge
function is always thekeyAuthorization
ofexample.com
. The reason for the failure is that I cannot modify the DNS server resolution by myself using thedns.setServers
method. If I want to customize the DNS server address, how can I do it?