Skip to content

Commit 072859e

Browse files
committed
add the ability to renew the CA when renewing all certs
1 parent 5da6033 commit 072859e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cli/Valet/Site.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,11 @@ public function secure(string $url, ?string $siteConf = null, int $certificateEx
502502
/**
503503
* Renews all domains with a trusted TLS certificate.
504504
*/
505-
public function renew($expireIn = 368): void
505+
public function renew($expireIn = 368, $ca = false): void
506506
{
507+
if ($ca) {
508+
$this->removeCa();
509+
}
507510
collect($this->securedWithDates())->each(function ($row) use ($expireIn) {
508511
$url = $this->domain($row['site']);
509512

cli/app.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,12 @@ function (ConsoleCommandEvent $event) {
306306
/**
307307
* Renews all domains with a trusted TLS certificate.
308308
*/
309-
$app->command('renew [--expireIn=]', function (OutputInterface $output, $expireIn = 368) {
310-
Site::renew($expireIn);
309+
$app->command('renew [--expireIn=] [--ca]', function (OutputInterface $output, $expireIn = 368, $ca = null) {
310+
Site::renew($expireIn, $ca);
311311
Nginx::restart();
312312
})->descriptions('Renews all domains with a trusted TLS certificate.', [
313313
'--expireIn' => 'The amount of days the self signed certificate is valid for. Default is set to "368"',
314+
'--ca' => 'Renew the Certificate Authority certificate before renewing the site certificates.',
314315
]);
315316

316317
/**

0 commit comments

Comments
 (0)