Rewrite to kelunik/acme version 0.3.0-dev
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
"ext-posix": "*",
|
"ext-posix": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"bramus/monolog-colored-line-formatter": "^2",
|
"bramus/monolog-colored-line-formatter": "^2",
|
||||||
"kelunik/acme": "dev-master",
|
"kelunik/acme": "^0.3",
|
||||||
"kelunik/certificate": "dev-master",
|
"kelunik/certificate": "^1",
|
||||||
"league/climate": "^3",
|
"league/climate": "^3",
|
||||||
"monolog/monolog": "^1.17",
|
"monolog/monolog": "^1.17",
|
||||||
"psr/log": "^1",
|
"psr/log": "^1",
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class Issue implements Command {
|
|||||||
|
|
||||||
$keyPair = $this->checkRegistration($args);
|
$keyPair = $this->checkRegistration($args);
|
||||||
|
|
||||||
$acme = new AcmeService(new AcmeClient($server, $keyPair), $keyPair);
|
$acme = new AcmeService(new AcmeClient($server, $keyPair));
|
||||||
|
|
||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
list($location, $challenges) = yield $acme->requestChallenges($domain);
|
list($location, $challenges) = yield $acme->requestChallenges($domain);
|
||||||
@@ -75,7 +75,7 @@ class Issue implements Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->logger->debug("Generating payload...");
|
$this->logger->debug("Generating payload...");
|
||||||
$payload = $acme->generateHttp01Payload($token);
|
$payload = $acme->generateHttp01Payload($keyPair, $token);
|
||||||
|
|
||||||
$docRoot = rtrim($args->get("path") ?? __DIR__ . "/../../data/public", "/\\");
|
$docRoot = rtrim($args->get("path") ?? __DIR__ . "/../../data/public", "/\\");
|
||||||
$path = $docRoot . "/.well-known/acme-challenge";
|
$path = $docRoot . "/.well-known/acme-challenge";
|
||||||
@@ -102,7 +102,7 @@ class Issue implements Command {
|
|||||||
chown("{$path}/{$token}", $userInfo["uid"]);
|
chown("{$path}/{$token}", $userInfo["uid"]);
|
||||||
chmod("{$path}/{$token}", 0664);
|
chmod("{$path}/{$token}", 0664);
|
||||||
|
|
||||||
yield $acme->selfVerify($domain, $token, $payload);
|
yield $acme->verifyHttp01Challenge($domain, $token, $payload);
|
||||||
$this->logger->info("Successfully self-verified challenge.");
|
$this->logger->info("Successfully self-verified challenge.");
|
||||||
|
|
||||||
yield $acme->answerChallenge($challenge->uri, $payload);
|
yield $acme->answerChallenge($challenge->uri, $payload);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class Register implements Command {
|
|||||||
chmod($pathPrivate, 0600);
|
chmod($pathPrivate, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
$acme = new AcmeService(new AcmeClient($server, $keyPair), $keyPair);
|
$acme = new AcmeService(new AcmeClient($server, $keyPair));
|
||||||
|
|
||||||
$this->logger->info("Registering with ACME server " . substr($server, 8) . " ...");
|
$this->logger->info("Registering with ACME server " . substr($server, 8) . " ...");
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Revoke implements Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$keyPair = $this->checkRegistration($args);
|
$keyPair = $this->checkRegistration($args);
|
||||||
$acme = new AcmeService(new AcmeClient($server, $keyPair), $keyPair);
|
$acme = new AcmeService(new AcmeClient($server, $keyPair));
|
||||||
|
|
||||||
$this->logger->info("Revoking certificate ...");
|
$this->logger->info("Revoking certificate ...");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user