Save certificates in account subfolder
This commit is contained in:
@@ -23,7 +23,10 @@ class Check implements Command {
|
|||||||
* @return \Generator
|
* @return \Generator
|
||||||
*/
|
*/
|
||||||
private function doExecute(Manager $args) {
|
private function doExecute(Manager $args) {
|
||||||
$path = dirname(dirname(__DIR__)) . "/data/certs";
|
$server = \Kelunik\AcmeClient\resolveServer($args->get("server"));
|
||||||
|
$server = \Kelunik\AcmeClient\serverToKeyname($server);
|
||||||
|
|
||||||
|
$path = dirname(dirname(__DIR__)) . "/data/certs/" . $server;
|
||||||
$certificateStore = new CertificateStore($path);
|
$certificateStore = new CertificateStore($path);
|
||||||
|
|
||||||
$pem = (yield $certificateStore->get($args->get("name")));
|
$pem = (yield $certificateStore->get($args->get("name")));
|
||||||
@@ -42,6 +45,12 @@ class Check implements Command {
|
|||||||
|
|
||||||
public static function getDefinition() {
|
public static function getDefinition() {
|
||||||
return [
|
return [
|
||||||
|
"server" => [
|
||||||
|
"prefix" => "s",
|
||||||
|
"longPrefix" => "server",
|
||||||
|
"description" => "",
|
||||||
|
"required" => true,
|
||||||
|
],
|
||||||
"name" => [
|
"name" => [
|
||||||
"longPrefix" => "name",
|
"longPrefix" => "name",
|
||||||
"description" => "Common name of the certificate to check.",
|
"description" => "Common name of the certificate to check.",
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class Issue implements Command {
|
|||||||
$location = (yield $acme->requestCertificate($keyPair, $domains));
|
$location = (yield $acme->requestCertificate($keyPair, $domains));
|
||||||
$certificates = (yield $acme->pollForCertificate($location));
|
$certificates = (yield $acme->pollForCertificate($location));
|
||||||
|
|
||||||
$path = dirname(dirname(__DIR__)) . "/data/certs";
|
$path = dirname(dirname(__DIR__)) . "/data/certs/" . $keyFile;
|
||||||
$certificateStore = new CertificateStore($path);
|
$certificateStore = new CertificateStore($path);
|
||||||
yield $certificateStore->put($certificates);
|
yield $certificateStore->put($certificates);
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class Revoke implements Command {
|
|||||||
yield $acme->revokeCertificate($pem);
|
yield $acme->revokeCertificate($pem);
|
||||||
$this->logger->info("Certificate has been revoked.");
|
$this->logger->info("Certificate has been revoked.");
|
||||||
|
|
||||||
yield (new CertificateStore(dirname(dirname(__DIR__)) . "/data/certs"))->delete($args->get("name"));
|
yield (new CertificateStore(dirname(dirname(__DIR__)) . "/data/certs/" . $keyFile))->delete($args->get("name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getDefinition() {
|
public static function getDefinition() {
|
||||||
|
|||||||
Reference in New Issue
Block a user