Skip to content

Comments

Automatically roll SSL certs#850

Open
rmccue wants to merge 4 commits intomasterfrom
automatically-roll-ssl-certs
Open

Automatically roll SSL certs#850
rmccue wants to merge 4 commits intomasterfrom
automatically-roll-ssl-certs

Conversation

@rmccue
Copy link
Member

@rmccue rmccue commented Sep 15, 2025

Automatically regenerates certificates on composer server start if they're expiring soon:
Screenshot 2025-09-15 at 15 22 30

Also changes composer server ssl to output remaining validity days:

$ composer server ssl
Certificate exists and is valid for 822 more days

And error if it's expired.

Fixes #849.

@rmccue
Copy link
Member Author

rmccue commented Sep 15, 2025

Remaining lint error is due to a PHP incompatibility, and is not part of this PR.

@rmccue rmccue requested a review from joehoyle September 15, 2025 15:38

break;
// Check certificate expiration.
$validity_remaining = $this->check_ssl_expiry( $cert_file );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm are we catching this error? Do we want to block being able to start the server if the openssl call fails? IMO best to just show a warning "Could not get certificate expiry details" but still start the server?

case '':
$cert_exists = file_exists( 'vendor/ssl-cert.pem' ) && file_exists( 'vendor/ssl-key.pem' );
$cert_file = 'vendor/ssl-cert.pem';
$cert_exists = file_exists( $cert_file ) && file_exists( $cert_file );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this second test be for the key file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically regenerate SSL certificates when expired

3 participants