Ubuntu 14.04 invalid security certificate


Referring this topic:

I changed in vhost configuration as instructed:

Change it to SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem and SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem.

So I have it like this now:

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www.nuriasol.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.nuriasol.net/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/www.nuriasol.net/chain.pem

Still I get the invalid certifate error:

nuriasol.net uses an invalid security certificate. The certificate is not trusted because it is self-signed. The certificate is not valid for the name nuriasol.net. Error code: SEC_ERROR_UNKNOWN_ISSUER”

Something stupid I fail to see here?
Originally I followed these instructions:


For some reason, a self-signed certificate is send for loft9004.dedicatedpanel.com. Strangely enough, also the Let’s Encrypt intermediate is send…??

What certificate do you get when you run:

openssl x509 -noout -text -in /etc/letsencrypt/live/www.nuriasol.net/fullchain.pem


hi @Santero

Did you restart your Apache server?

Also run a check as per what @Osiris suggested



openssl x509 -noout -text -in /etc/letsencrypt/live/www.nuriasol.net/fullchain.pem

Gives as below, but I have to run it as sudo…? Is that normal.
I did restart Apache.

Version: 3 (0x2)
Serial Number:
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US, O=Let’s Encrypt, CN=Let’s Encrypt Authority X3
Not Before: Apr 9 02:57:00 2017 GMT
Not After : Jul 8 02:57:00 2017 GMT
Subject: CN=www.nuriasol.net
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
X509v3 Subject Key Identifier:
X509v3 Authority Key Identifier:

        Authority Information Access:
            OCSP - URI:http://ocsp.int-x3.letsencrypt.org/
            CA Issuers - URI:http://cert.int-x3.letsencrypt.org/
        X509v3 Subject Alternative Name:
        X509v3 Certificate Policies:
              CPS: http://cps.letsencrypt.org
              User Notice:
                Explicit Text: This Certificate may only be relied upon by Relying Parties and only in accordance with the Certificate Policy found at https://letsencrypt.org/repository/
Signature Algorithm: sha256WithRSAEncryption


That’s the certificate for www.nuriasol.net alright (but not for nuriasol.net!). And that is not the certificate send by the webserver…

Did you install those Apache directives in the right <VirtualHost> section?


Hi and thanks.
For some reason there are two virtual host configurations:

with a setting for both www.nuriasol.net and nuriasol.net and a redirect a redirect:

<VirtualHost *:80>
ServerAdmin XXXXXXXX
ServerAlias nuriasol.net www.nuriasol.net

   DocumentRoot /home/nuriasol/public_html/

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.nuriasol.net [OR]
RewriteCond %{SERVER_NAME} =nuriasol.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

And nuriasol.net-le-ssl.conf with

ServerAdmin xxxxxxx ServerAlias nuriasol.net www.nuriasol.net
   DocumentRoot /home/nuriasol/public_html/

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www.nuriasol.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.nuriasol.net/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/www.nuriasol.net/chain.pem


Probably one with <VirtualHost *:80> for the HTTP requests and the other <VirtualHost *:443> for the HTTPS site. That’s normal and doesn’t explain why your webserver isn’t serving the correct certificate :worried:


Yes, that is correct.
One for 80 and one for 443.

Should I remove the certificate (how?) and try again?


I doubt that’s useful. Somehow there’s a certificate served for loft9004.dedicatedpanel.com.

One thing I saw in your configuration files is you’re using only ServerAlias and not ServerName. This could be a problem for Apache: https://httpd.apache.org/docs/2.4/mod/core.html#servername

You should change:

ServerAlias nuriasol.net www.nuriasol.net


ServerName nuriasol.net
ServerAlias www.nuriasol.net

Also: you have two certificates issued currently:

This is problematic if you’re using both hostnames in a single <VirtualHost> section, because Apache will just serve one certificate for both hostnames. Options are:

  • Split both hostnames in two separate files both with their own <VirtualHost> section pointing to the correct certificate;
  • Get a third certificate but now for BOTH hostnames and use that new certificate in the current <VirtualHost> section.


If I try to ask for a certificate for both, it fails on a timeout now (certbot-auto --apache -d nuriasol.net -d www.nuriasol.net)

I can of course create separate vhost files, but they at the moment only contain the rewrite rule, i.e. they are not pointing to any certificate.
The certificates are mentioned in the nuriasol.net-le-ssl.conf file.
Maybe if I delete that, and put the corresponding

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www.nuriasol.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.nuriasol.net/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/www.nuriasol.net/chain.pem
To each vhost file?

I think the problem originally occurred, because I created tha certificate separately for www.nuriasol.net and nuriasol.net, while they were having one vhost file only (with both configured as aliases: I fixed that)


Ok. Thanks guys.
They work now.

Created a vhost file for www.nuriasol.net and for nuriasol.net separately, as there are two certificates because of my mistake…
Then deleted the nuriasol.net-le-ssl.conf file.

Then added the reference to the corresponding certificates on the end of the vhost configurations.
Re-enabled both vhosts and then reloaded apache.

Thanks again for great tips.


That’s because certbot has generated a specific configuration file for the HTTPS site: the nuriasol.net-le-ssl.conf file.

The original file nuriasol.net.conf should contain a <VirtualHost *:80> and the nuriasol.net-le-ssl.conf file contained a <VirtualHost *:443> section, respectively the virtualhost section for HTTP and HTTPS.

Euh, did you add the SSL directives to the <VirtualHost *:80> sections? :worried: Although I’m seeing your HTTPS site actually works, so I guess you added it to the correct virtualhost section :stuck_out_tongue:

Unfortunately, your redirect isn’t working now… If I go to http://www.nuriasol.net I’m seeing an Apache test page. Perhaps you’ve modified your <VirtualHost *:80> sections to <VirtualHost *:443> sections, and now your HTTP site isn’t working any more?


Yes that’s what I did, and for some reason neither is working now: Both are showing the default site.


Well. They are working with the https, but http does not automatically redirect to that.


Ok. Now they work as expexted.
Created Vhosts sections for both 80 and 443 with redirect for both conf files: www.nuriasol.net and nuriasol.net

   <VirtualHost *:80>
   ServerAdmin      XXXXXX
   ServerName www.nuriasol.net
   Redirect permanent / https:/www.nuriasol.net/
  <VirtualHost _default_:443>
   ServerAdmin      XXXXX
   ServerName www.nuriasol.net

    SSLEngine on etc...

Learned a lot: Longtime project for me to make a few sites https.
Due to complexity and price did not make the effort until now!


And now you can enter your site(s) into https://whynopadlock.com because there are a lot of non-secure resources loaded on the page, which will remove the green padlock and turn it into a “non-secure” variant!

Also, be advised, this redirect variant will give you issues with the webroot authenticator! I don’t know if you’ve used that authenticator or the apache plugin, but when using webroot, Let’s Encrypt requests the token from the HTTP site in the directory /.well-known/acme-challenge/. With this redirect, the path (/.well-known/acme-challenge/tOkEn) is removed when redirecting!

So if your renewal won’t work because you’re using the webroot plugin and this redirect, you now know why :wink:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.