acmephp / acmephp
Let's Encrypt client written in PHP
Installs: 137 807
Dependents: 1
Suggesters: 0
Security: 0
Stars: 610
Watchers: 13
Forks: 106
Open Issues: 21
Type:project
Requires
- php: >=7.2.5
- ext-filter: *
- ext-hash: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- lib-openssl: >=0.9.8
- alibabacloud/cdn: ^1.7
- alibabacloud/wafopenapi: ^1.7
- aws/aws-sdk-php: ^3.38
- guzzlehttp/guzzle: ^7.2
- guzzlehttp/psr7: ^1.0
- lcobucci/jwt: ^3.3|^4.0
- league/flysystem: ^1.0.19
- league/flysystem-memory: ^1.0
- league/flysystem-sftp: ^1.0.7
- monolog/monolog: ^1.19|^2.0
- padraic/phar-updater: ^1.0
- psr/container: ^1.0
- psr/http-message: ^1.0
- psr/log: ^1.0
- symfony/config: ^5.0|^6.0
- symfony/console: ^5.0|^6.0
- symfony/dependency-injection: ^5.0|^6.0
- symfony/filesystem: ^5.0|^6.0
- symfony/serializer: ^5.0|^6.0
- symfony/yaml: ^5.0|^6.0
- webmozart/assert: ^1.0
- webmozart/path-util: ^2.3
Requires (Dev)
- phpspec/prophecy: ^1.9
- symfony/finder: ^5.0|^6.0
- symfony/phpunit-bridge: ^5.0|^6.0
- symfony/var-dumper: ^5.0|^6.0
Suggests
- daverandom/libdns: ^2.0
- dev-master
- 2.1.0
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 1.0.0-beta5
- 1.0.0-beta4
- 1.0.0-beta3
- 1.0.0-beta2
- 1.0.0-beta1
- 1.0.0-alpha10
- 1.0.0-alpha9
- 1.0.0-alpha8
- dev-improve-pem-parsing
- dev-phar-build-artifact
- dev-feat-build-docker
- dev-lyrixx-phpstan
- dev-feat-update-self-updater
- dev-revert-275-fix-allow-psr-http-message-2
- dev-fix-allow-psr-http-message-2
- dev-csr-pem
This package is auto-updated.
Last update: 2024-10-26 13:57:02 UTC
README
Acme PHP is a simple yet very extensible CLI client for Let's Encrypt that will help you get and renew free HTTPS certificates.
Acme PHP is also an initiative to bring a robust, stable and powerful implementation of the ACME protocol in PHP. Using the Acme PHP library and core components, you will be able to deeply integrate the management of your certificates directly in your application (for instance, renew your certificates from your web interface). If you are interested by these features, have a look at the acmephp/core and acmephp/ssl libraries.
Acme PHP is now maintained by https://zerossl.com.
Why should I use Acme PHP when I have an official client?
Acme PHP provides several major improvements over the default clients:
- Acme PHP comes by nature as a single binary file: a single download and you are ready to start working ;
- Acme PHP is based on a configuration file instead command line arguments. Thus, the configuration is much more expressive and the same setup is used at every renewal ;
- Acme PHP is very extensible it to create the certificate files structure you need for your webserver. It brings several default formatters to create classical file structures (nginx, nginx-proxy, haproxy, etc.) but you can very easily create your own if you need to ;
- Acme PHP follows a strict BC policy preventing errors in your scripts or CRON even if you update it (see the Backward Compatibility policy of Acme PHP for more informations) ;
Documentation
Read the official Acme PHP documentation.
Backward Compatibility policy
Acme PHP follows a strict BC policy by sticking carefully to semantic versioning. This means your scripts, your CRON tasks and your code will keep working properly even when you update Acme PHP (either the CLI tool or the library), as long as you keep the same major version (1.X.X, 2.X.X, etc.).
Launch the Test suite
The Acme PHP test suite uses the Docker Boulder image to create an ACME server.
To launch the test suite, you need to setup the proper Docker environment for the suite.
Useful scripts are available under the tests
directory: in the Acme PHP root directory,
execute the following:
# Create the Docker environment required for the suite
sudo tests/setup.sh
# Run the tests
tests/run.sh
# Clean the docker environment
tests/teardown.sh
Note: you may have boulder errors sometimes in tests. Simply ignore them and rerun the suite, they are due to an issue in the container DNS.
Warning: as the acmephp/testing-ca Docker image needs to be mapped to the host network, you may have ports conflicts. See https://github.com/acmephp/testing-ca for more informations.
Run command
The run command is an all in one command who works with a domain
config file like
contact_email: contact@company key_type: RSA # RSA or EC (for ECDSA). Default "RSA" defaults: distinguished_name: country: FR locality: Paris organization_name: MyCompany solver: http certificates: - domain: example.com distinguished_name: organization_name: MyCompany Internal solver: route53 subject_alternative_names: - '*.example.com' - www.subdomain.example.com install: - action: install_aws_elb region: eu-west-1 loadbalancer: my_elb - domain: www.example.com solver: name: http-file adapter: ftp # ftp or sftp or local, see https://flysystem.thephpleague.com/ root: /var/www/ host: ftp.example.com username: username password: password # port: 21 # passive: true # ssl: true # timeout: 30 # privateKey: path/to/or/contents/of/privatekey
usage
$ acmephp run path-to-config.yml
Using docker
You can also use the docker image to generate certificates.
Certificates and keys are stored into the volume /root/.acmephp
docker run --rm -ti -v /cache/.acmephp:/root/.acmephp -v $PWD/.config.yml:/etc/acmephp.yml:ro acmephp/acmephp:latest run /etc/acmephp.yml