skoerfgen / ACMECert

PHP client library for Let's Encrypt and other ACME v2 - RFC 8555 compatible Certificate Authorities

Home Page:https://github.com/skoerfgen/ACMECert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a php script about the dnsapi

6tu-git opened this issue · comments

This is a script about the dnsapi, It has many bugs, How to better cooperate with ACMECert

dns_he.php.txt

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);

_
I just started to learn PHP myself.

modified several times dns_he.php ,

finally made a certificate success.

Thank you for your advice.

_