This is a php script about the dnsapi
6tu-git opened this issue · comments
liuyun commented
This is a script about the dnsapi, It has many bugs, How to better cooperate with ACMECert
Stefan Körfgen commented
Does this help?
$ac->loadAccountKey('file://account_key.pem');
$domain_config=array(
'*.example.com'=>array('challenge'=>'dns-01')
);
$handler=function($opts)use($dns){
$zone_id = dns_he_find_zone($opts['key']);
dns_he_add($dns, $opts['key'], $opts['value'], $zone_id);
return function($opts)use($dns,$zone_id){
dns_he_rm($dns, $opts['key'], $opts['value'], $zone_id);
};
};
$fullchain=$ac->getCertificateChain('file://cert_private_key.pem',$domain_config,$handler);
file_put_contents('fullchain.pem',$fullchain);
liuyun commented
_
I just started to learn PHP myself.
modified several times dns_he.php ,
finally made a certificate success.
Thank you for your advice.
_