Display Morewe had the same problems, here is a hot fix which worked for us:
Display MoreCode
- cd /usr/share/ca-certificates/mozilla/
- wget https://letsencrypt.org/certs/lets-encrypt-r3.pem
- mv lets-encrypt-r3.pem lets-encrypt-r3.crt
- dpkg-reconfigure ca-certificates # -->> add new letsencrypt Cert
- vi /var/www/imscp/engine/PerlLib/iMSCP/OpenSSL.pm +134 #comment out line 134
- my $cmd = [
- 'openssl', 'verify',
- # ( ( $self->{'ca_bundle_container_path'} ne '' ) ? ( '-CAfile', $self->{'ca_bundle_container_path'} ) : () ),
- '-purpose', 'sslserver', $self->{'certificate_container_path'}
- ];
what it does:
- adding new letsencrypt CA cert to /etc/ssl/certs
- removing "-CAfile fullchain1.pem" from openssl command (its not necessary anymore because openssl knows it now)
Regards, Joern
ps: Debian 9 / i-MSCP 1.5.3 Build: 2018120800uild: 2018120800
A good solution for fixing Let's Encrypt, but...
everything seems to work with the letsencrypt patch, but I discovered a problem when installing a purchased certificate ...
To install a paid certificate line 134 needs to be reactivated in OpenSSL.pm (afterwards deactivate again).
... it had issues with paid certificates.
I continued the work on Joern's approach. As per his instructions, start with:
The next step is to edit /var/www/imscp/engine/PerlLib/iMSCP/OpenSSL.pm with editor of your choice. As Joern instructed, start by commenting out the line at 135. However, to allow paid certificates with CA bundle continue to work, if the initial verify command fails, then we need to try to run it with the CAfile parameter. This is done by adding the code below after line 140 debug( $stdout ) if $stdout;:
- # If an error state was returned, run again with CA bundle (support for paid certs)
- if ( $rs && ( $self->{'ca_bundle_container_path'} ne '' ) ) {
- $cmd = [
- 'openssl', 'verify',
- ( ( $self->{'ca_bundle_container_path'} ne '' ) ? ( '-CAfile', $self->{'ca_bundle_container_path'} ) : () ),
- '-purpose', 'sslserver', $self->{'certificate_container_path'}
- ];
- $rs = execute( $cmd, \ $stdout, \ $stderr );
- debug( $stdout ) if $stdout;
- }
Full code from line 132 (old) to 157 (new) with a few comments for clarity:
- # COMMENTED OUT LINE 135
- my $cmd = [
- 'openssl', 'verify',
- # ( ( $self->{'ca_bundle_container_path'} ne '' ) ? ( '-CAfile', $self->{'ca_bundle_container_path'} ) : () ),
- '-purpose', 'sslserver', $self->{'certificate_container_path'}
- ];
- my $rs = execute( $cmd, \ my $stdout, \ my $stderr );
- debug( $stdout ) if $stdout;
- # ADDED: If an error state was returned, run again with CA bundle (support for paid certs)
- if ( $rs && ( $self->{'ca_bundle_container_path'} ne '' ) ) {
- $cmd = [
- 'openssl', 'verify',
- ( ( $self->{'ca_bundle_container_path'} ne '' ) ? ( '-CAfile', $self->{'ca_bundle_container_path'} ) : () ),
- '-purpose', 'sslserver', $self->{'certificate_container_path'}
- ];
- $rs = execute( $cmd, \ $stdout, \ $stderr );
- debug( $stdout ) if $stdout;
- }
- # STOP EDITS HERE
- error( sprintf(
- "SSL certificate is not valid: %s",
- ( $stderr || $stdout || 'Unknown error' ) =~ s/$self->{'certificate_container_path'}:\s+//r
- )) if $rs;
Disclaimer: use at your own risk.