Download the PHP package daanra/laravel-lets-encrypt without Composer
On this page you can find all versions of the php package daanra/laravel-lets-encrypt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daanra/laravel-lets-encrypt
More information about daanra/laravel-lets-encrypt
Files in daanra/laravel-lets-encrypt
Package laravel-lets-encrypt
Short Description A Laravel package to easily generate SSL certificates using Let's Encrypt
License MIT
Homepage https://github.com/daanra/laravel-lets-encrypt
Informations about the package laravel-lets-encrypt
Let's Encrypt Laravel
A Laravel package for easily generating and renewing SSL certificates using Let's Encrypt. This package is especially useful if you have a Laravel application that manages the SSL certificates of many domains. This package is not recommended if you just need to generate a single SSL certificate for your application.
This package is essentially a Laravel-friendly wrapper around Acme PHP.
Installation
You can install the package via composer:
If you're having installation problems with conflicting dependencies caused by Guzzle then you might want to run:
Publish the configuration file and the migration:
Run the migration:
Note:
You somehow have to return a stored challenge whenever it it retrieved from the /.well-known/acme-challenge
endpoint. You could do this by configuring NGINX/Apache appropriately or by registering a route:
Sometimes the /.well-known/
prefix is disabled by default in the NGINX/Apache config (see #4). Make sure it is forwarded to your Laravel application if you want Laravel to return the challenge.
Usage
Creating a new SSL certificate for a specific domain is easy:
Alternative syntax available from v0.3.0:
Where you can specify values for all jobs:
- tries (The number of times the job may be attempted)
- retryAfter (The number of seconds to wait before retrying the job)
- retryList (The list of seconds to wait before retrying the job)
- chain (Chain some jobs after the certificate has successfully been obtained)
- delay (Set the desired delay for the job)
You could also achieve the same by using an artisan command:
Certificates are stored in the database. You can query them like so:
Subject Alternative Names
It's also possible to specify Subject Alternative Names as below (requires >= 0.5.0):
Failure events
If one of the jobs fails, one of the following events will be dispatched:
Every event implements the Daanra\LaravelLetsEncrypt\Interfaces\LetsEncryptCertificateFailed
interface so you can listen for that as well.
Automatically renewing certificates
Certificates are valid for 90 days. Before those 90 days are over, you will want to renew them. To do so, you
could add the following to your App\Console\Kernel
:
This will automatically renew every certificate that is older than 60 days, ensuring that they never expire.
Configuration
By default this package will use Let's Encrypt's staging server to issue certificates. You should set:
in the .env
file of your production server.
By default, this package will attempt to validate a certificate using a HTTP-01 challenge.
For this reason, a file will be temporarily stored in your application's storage directory under the path
app/public/.well-known/acme-challenge/<CHALLENGE_TOKEN>
. You can customise this behavior by setting a custom
PathGenerator
class in your config under path_generator
. Note that Let's Encrypt expects the following path:
to return the contents of the file located at $pathGenerator->getPath($token)
.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker. If you have a question, please open an issue instead of sending an email.
Credits
- Daan Raatjes
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-lets-encrypt with dependencies
ext-openssl Version *
guzzlehttp/guzzle Version ^7.4
illuminate/console Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/filesystem Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0