3 Commits

Author SHA1 Message Date
Niklas Keller
6bfa882aa0 Fix PHP 5 compat in CertificateStore 2016-03-15 13:21:44 +01:00
Niklas Keller
19bc2af47d Add certificate keyword 2016-03-13 19:23:41 +01:00
Niklas Keller
61b463ad70 Add keywords to composer.json 2016-03-13 18:26:34 +01:00
2 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,15 @@
{
"name": "kelunik/acme-client",
"description": "Standalone PHP ACME client.",
"keywords": [
"ACME",
"letsencrypt",
"certificate",
"https",
"encryption",
"ssl",
"tls"
],
"require": {
"amphp/process": "^0.1.1",
"bramus/monolog-colored-line-formatter": "^2",

View File

@@ -2,6 +2,7 @@
namespace Kelunik\AcmeClient\Stores;
use Amp\CoroutineResult;
use Amp\File\FilesystemException;
use InvalidArgumentException;
use Kelunik\Certificate\Certificate;
@@ -26,7 +27,8 @@ class CertificateStore {
Assert::string($name, "Name must be a string. Got: %s");
try {
return yield \Amp\File\get($this->root . "/" . $name . "/cert.pem");
$contents = (yield \Amp\File\get($this->root . "/" . $name . "/cert.pem"));
yield new CoroutineResult($contents);
} catch (FilesystemException $e) {
throw new CertificateStoreException("Failed to load certificate.", 0, $e);
}
@@ -88,4 +90,4 @@ class CertificateStore {
yield \Amp\File\rmdir($this->root . "/" . $name);
}
}
}