An open API service indexing awesome lists of open source software.

https://github.com/kelunik/aerys-acme

Automagically issue certificates for encrypted hosts in Aerys.
https://github.com/kelunik/aerys-acme

Last synced: 3 months ago
JSON representation

Automagically issue certificates for encrypted hosts in Aerys.

Awesome Lists containing this project

README

        

# aerys-acme

ACME is a protocol to automate certificate issuance and renewal. [Aerys](https://github.com/amphp/aerys) provides a feature to encrypt hosts automatically using ACME.

## installation

```
composer require kelunik/aerys-acme:dev-master
```

## usage

```php
expose("*", 443)
->name("example.com");

// Currently we need a redirect, because the spec requires
// the initial HTTP challenge to use HTTP instead of HTTPS.
// If you don't want to redirect all traffic, just redirect
// everything starting with "/.well-known/acme-challenge/".
$http = (new Host)
->expose("*", 80)
->name("example.com")
->redirect("https://example.com");

// this will issue a test certificate, see below
return (new AcmeHost($https, __DIR__ . "/ssl"))
->acceptAgreement(LETS_ENCRYPT_AGREEMENT)
->encrypt(LETS_ENCRYPT_STAGING, ["mailto:[email protected]"]);

// if your domain is already whitelisted for Let's Encrypt's closed beta,
// use the right server to obtain a real certificate
// return (new AcmeHost($https, __DIR__ . "/ssl"))
// ->acceptAgreement(LETS_ENCRYPT_AGREEMENT)
// ->encrypt(LETS_ENCRYPT_BETA, ["mailto:[email protected]"]);
```