coollabsio/coolify · error · Exception
Failed to process certificate.
Error message
Failed to process certificate.
What it means
The certificate parsed successfully (openssl_x509_read returned a resource) but openssl_x509_export() returned false when re-encoding it to normalized PEM. This is rare: export of a just-parsed certificate seldom fails, and usually points to an OpenSSL library issue, memory limits, or an exotic/malformed certificate structure that parses but cannot be serialized.
Source
Thrown at app/Livewire/Server/CaCertificate/Show.php:69
{
$this->showCertificate = ! $this->showCertificate;
}
public function saveCaCertificate()
{
try {
$this->authorize('manageCaCertificate', $this->server);
if (! $this->certificateContent) {
throw new \Exception('Certificate content cannot be empty.');
}
$parsedCert = openssl_x509_read($this->certificateContent);
if (! $parsedCert) {
throw new \Exception('Invalid certificate format.');
}
if (! openssl_x509_export($parsedCert, $cleanedCertificate)) {
throw new \Exception('Failed to process certificate.');
}
$this->certificateContent = $cleanedCertificate;
if ($this->caCertificate) {
$this->caCertificate->ssl_certificate = $this->certificateContent;
$this->caCertificate->save();
$this->loadCaCertificate();
$this->writeCertificateToServer();
dispatch(new RegenerateSslCertJob(
server_id: $this->server->id,
force_regeneration: true
));
}
$this->dispatch('success', 'CA Certificate saved successfully.');
} catch (\Throwable $e) {View on GitHub (pinned to 70b9acc424)
Solutions
- Re-export the certificate on your workstation (openssl x509 -in cert.pem -outform PEM) and paste the freshly normalized PEM
- Check PHP error log for OpenSSL warnings and memory exhaustion at the time of the failure
- Verify PHP OpenSSL support: php -i | grep OpenSSL, and confirm extension version consistency after upgrades
- Raise memory_limit if the log shows exhaustion, then retry the save
Defensive patterns
Strategy: try-catch
Try / catch
Wrap the parse/export pair in one try/catch (Throwable); on export failure keep the submitted (parsed) content unmodified, dispatch('error', ...), and inspect PHP error logs for the underlying OpenSSL warning instead of retrying blindly. Prevention
- Normalize PEMs offline first: openssl x509 -in cert.pem -outform PEM
- Keep PHP/OpenSSL versions consistent after system upgrades
- Watch memory_limit when importing unusually large certificate material
When it happens
Trigger: Unusual certificate encodings or corrupt base64 that still skims through the parser; PHP OpenSSL extension/version mismatches after an upgrade; memory_limit exhaustion during export of very large chains.
Common situations: After a PHP/OpenSSL package upgrade on the host; importing certificates from uncommon CAs or appliances; low memory_limit configurations.
Understand the failure class
- SSL/TLS and certificate errors — how TLS handshakes and certificate validation fail.
Related errors
- Invalid certificate format.
- SSL Certificate generation failed: {$e->getMessage()}
- Failed to generate private key: {openssl_error_string()}
- Failed to export private key: {openssl_error_string()}
- Failed to generate CSR: {openssl_error_string()}
AI-assisted analysis of coollabsio/coolify@70b9acc424 (2026-08-17).
Data as JSON: /api/errors/69b571982d63532e.
Report an issue: GitHub.