Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bfa882aa0 | ||
|
|
19bc2af47d | ||
|
|
61b463ad70 |
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user