Hello,
Below I will present a workaround for issues with Let's Encrypt.
ATTENTION !!
The workaround below is only a workaround and is not a 100% fix to the issue created by the certificate publisher Let's Encrypt !! You use it at your own risk.
The possible consequences of applying this patch may cause Apache2 to stop and crash !!
Edit File: /var/www/imscp/engine/PerlLib/Modules/SSLcertificate.pm
Before: (currently)
- 155: # Check certificate chain
- 156: $rs = $openSSL->validateCertificateChain();
- 157:
- 158: # Create certificate chain (private key, certificate and CA bundle)
- 159: $rs ||= $openSSL->createCertificateChain();
After: (FIX)
- 155: # Check certificate chain
- 156: # $rs = $openSSL->validateCertificateChain();
- 157:
- 158: # Create certificate chain (private key, certificate and CA bundle)
- 159: # $rs ||= $openSSL->createCertificateChain();
- 160: $openSSL->createCertificateChain();
ATTENTION !!
Remember this is just a workaround !!
The above fix also applies to native certificate handling in the i-MSCP panel.
================
EDIT: 03.11.2021
ATTENTION !!
Please select and do just one fix for this problem !!
If you chose the first workaround, do not apply the fix below unless you go back the changes from the previous step.
or a safer form of amendment:
Edit File: /var/www/imscp/gui/plugins/LetsEncrypt/backend/LetsEncrypt.pm
Before: (currently)
- 616: $self->{'_dbh'}->do(
- 617: "INSERT INTO ssl_certs (domain_id, domain_type, private_key, certificate, ca_bundle, status) VALUES (?, ?, ?, ?, ?, 'toadd')",
- 618: undef, $certData->{'domain_id'}, $certData->{'domain_type'}, $certData->{'files'}->{'privkey'}, $certData->{'files'}->{'cert'},
- 619: $certData->{'files'}->{'chain'}
- 620: );
After: (FIX)
- 616: $self->{'_dbh'}->do(
- 617: "INSERT INTO ssl_certs (domain_id, domain_type, private_key, certificate, status) VALUES (?, ?, ?, ?, 'toadd')",
- 618: undef, $certData->{'domain_id'}, $certData->{'domain_type'}, $certData->{'files'}->{'privkey'}, $certData->{'files'}->{'cert'}
- 619: );
and
Before: (currently)
- 623: $self->{'_dbh'}->do(
- 624: "UPDATE ssl_certs SET private_key = ?, certificate = ?, ca_bundle = ?, status = 'tochange' WHERE cert_id = ?",
- 625: undef, $certData->{'files'}->{'privkey'}, $certData->{'files'}->{'cert'}, $certData->{'files'}->{'chain'}, $certId
- 626: );
After: (FIX)
- 623: $self->{'_dbh'}->do(
- 624: "UPDATE ssl_certs SET private_key = ?, certificate = ?, status = 'tochange' WHERE cert_id = ?",
- 625: undef, $certData->{'files'}->{'privkey'}, $certData->{'files'}->{'cert'}, $certId
- 626: );
Then you need to revoke damaged Let's Encrypt certificate installations for domains and re-create the vhost without using the CA certificate chain which are verified before installation.
The problem is that Let's Encrypt issues an intermediate "ISRG Root X1" certificate signed by the expired "DST Root CA X3" when signing the certificate instead of using the new "ISRG Root X1" certificate of the same type as the old "DST Root CA X3" certificate, ie self-signed.
Both of my patches were checked and approved by me before I posted them here.
My system is: Debian Stretch 9.13