Https://www.mysite.com Not Covered By https://mysite.com Cert

My domain is: sandbarsoftware.ie

I ran this command on the browser: https://sandbarsoftware.ie

The I ran this URL: https://www.sandbarsoftware.ie

It produced this output:

Warning: Potential Security Risk Ahead

Firefox Developer Edition detected a potential security threat and did not continue to www.sandbarsoftware.ie. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.

What can you do about it?

The issue is most likely with the website, and there is nothing you can do to resolve it. You can notify the website’s administrator about the problem.

Learn more…

Websites prove their identity via certificates. Firefox Developer Edition does not trust this site because it uses a certificate that is not valid for www.sandbarsoftware.ie. The certificate is only valid for sandbarsoftware.ie.
 
Error code: SSL_ERROR_BAD_CERT_DOMAIN
 
View Certificate

My web server is (include version): Apache/2.4.52 (Ubuntu)
Server built: 2023-03-08T17:32:01

The operating system my web server runs on is (include version): Ubuntu 22.04.2 LTS

My hosting provider, if applicable, is: OVH

I can login to a root shell on my machine (yes or no, or I don't know): YES

NO CONTROL PANEL IS USED WITH MY WEBSITE AS MY SERVER IS A VPS.
HOWEVER I DO USE THE OVH VPS CONTROL PANEL TO MANAGE MY VPS AND ITS ASSOCIATED DOMAIN NAME.

I CONFIGURED SEPARATE "A RECORDS" FOR BOTH MY DOMAIN NAME AND ITS WWW SUB-DOMAIN NAME. THE WWW SUB-DOMAIN WAS ONLY DONE TODAY AND IT WILL TAKE 1-2 DAYS TO PROPAGATE, I'M TOLD. THIS MAY OR MAY NOT HAVE RELEVANCE TO THIS ISSUE.

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 1.21.0

My website's .conf file is:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerName sandbarsoftware.ie
        ServerAlias www.sandbarsoftware.ie
        ServerAdmin xx@yyyyyyyyyyyyyyyy
        DocumentRoot /var/www/html/sandbarsoftware.ie

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
RewriteEngine on
#RewriteCond %{SERVER_NAME} =sandbarsoftware.ie
RewriteCond %{SERVER_NAME} ^(www\.)?sandbarsoftware.ie$
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Notice I commented out the Certbot written RewriteCond and inserted one that I thought would embrace www sub-domains also.

But there is no change.

I also removed old self-signed SSLCertificate and SSLCertificateKey file pointer values from the default configuration file, /etc/apache2/sites-available/default-ssl.conf:

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                #SSLEngine on

                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.

                #   Server Certificate Chain:
                #   Point SSLCertificateChainFile at a file containing the
                #   concatenation of PEM encoded CA certificates which form the
                #   certificate chain for the server certificate. Alternatively
                #   the referenced file can be the same as SSLCertificateFile
                #   when the CA certificates are directly appended to the server
                #   certificate for convinience.
                #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

                #   Certificate Authority (CA):
                #   Set the CA certificate verification path where to find CA
                #   certificates for client authentication or alternatively one
                #   huge file containing all of them (file must be PEM encoded)
                #   Note: Inside SSLCACertificatePath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCACertificatePath /etc/ssl/certs/
                #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
#   Certificate Revocation Lists (CRL):
                #   Set the CA revocation path where to find CA CRLs for client
                #   authentication or alternatively one huge file containing all
                #   of them (file must be PEM encoded)
                #   Note: Inside SSLCARevocationPath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCARevocationPath /etc/apache2/ssl.crl/
                #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

                #   Client Authentication (Type):
                #   Client certificate verification type and depth.  Types are
                #   none, optional, require and optional_no_ca.  Depth is a
                #   number which specifies how deeply to verify the certificate
                #   issuer chain before deciding the certificate is not valid.
                #SSLVerifyClient require
                #SSLVerifyDepth  10

                #   SSL Engine Options:
                #   Set various options for the SSL engine.
                #   o FakeBasicAuth:
                #        Translate the client X.509 into a Basic Authorisation.  This means that
                #        the standard Auth/DBMAuth methods can be used for access control.  The
                #        user name is the `one line' version of the client's X.509 certificate.
                #        Note that no password is obtained from the user. Every entry in the user
                #        file needs this password: `xxj31ZMTZzkVA'.
                #   o ExportCertData:
                #        This exports two additional environment variables: SSL_CLIENT_CERT and
                #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
                #        server (always existing) and the client (only existing when client
                #        authentication is used). This can be used to import the certificates
                #        into CGI scripts.
                #   o StdEnvVars:
                #        This exports the standard SSL/TLS related `SSL_*' environment variables.
                #        Per default this exportation is switched off for performance reasons,
                #        because the extraction step is an expensive operation and is usually
                #        useless for serving static content. So one usually enables the
                #        exportation for CGI and SSI requests only.
                #   o OptRenegotiate:
                #        This enables optimized SSL connection renegotiation handling when SSL
                #        directives are used in per-directory context.
                #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                #   SSL Protocol Adjustments:
                #   The safe and default but still SSL/TLS standard compliant shutdown
                #   approach is that mod_ssl sends the close notify alert but doesn't wait for
                #   the close notify alert from client. When you need a different shutdown
                #   approach you can use one of the following variables:
                #   o ssl-unclean-shutdown:
                #        This forces an unclean shutdown when the connection is closed, i.e. no
                #        SSL close notify alert is send or allowed to received.  This violates
                #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
                #        this when you receive I/O errors because of the standard approach where
                #        mod_ssl sends the close notify alert.
                #   o ssl-accurate-shutdown:
                #        This forces an accurate shutdown when the connection is closed, i.e. a
                #        SSL close notify alert is send and mod_ssl waits for the close notify
                #        alert of the client. This is 100% SSL/TLS standard compliant, but in
                #        practice often causes hanging connections with brain-dead browsers. Use
                #        this only for browsers where you know that their SSL implementation
                #        works correctly.
                #   Notice: Most problems of broken clients are also related to the HTTP
                #   keep-alive facility, so you usually additionally want to disable
                #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
                #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
                #   their broken HTTP/1.1 implementation. Us<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                #SSLEngine on

                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.

                #   Server Certificate Chain:
                #   Point SSLCertificateChainFile at a file containing the
                #   concatenation of PEM encoded CA certificates which form the
                #   certificate chain for the server certificate. Alternatively
                #   the referenced file can be the same as SSLCertificateFile
                #   when the CA certificates are directly appended to the server
                #   certificate for convinience.
                #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

                #   Certificate Authority (CA):
                #   Set the CA certificate verification path where to find CA
                #   certificates for client authentication or alternatively one
                #   huge file containing all of them (file must be PEM encoded)
                #   Note: Inside SSLCACertificatePath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCACertificatePath /etc/ssl/certs/
                #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
#   Certificate Revocation Lists (CRL):
                #   Set the CA revocation path where to find CA CRLs for client
                #   authentication or alternatively one huge file containing all
                #   of them (file must be PEM encoded)
                #   Note: Inside SSLCARevocationPath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCARevocationPath /etc/apache2/ssl.crl/
                #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

                #   Client Authentication (Type):
                #   Client certificate verification type and depth.  Types are
                #   none, optional, require and optional_no_ca.  Depth is a
                #   number which specifies how deeply to verify the certificate
                #   issuer chain before deciding the certificate is not valid.
                #SSLVerifyClient require
                #SSLVerifyDepth  10

                #   SSL Engine Options:
                #   Set various options for the SSL engine.
                #   o FakeBasicAuth:
                #        Translate the client X.509 into a Basic Authorisation.  This means that
                #        the standard Auth/DBMAuth methods can be used for access control.  The
                #        user name is the `one line' version of the client's X.509 certificate.
                #        Note that no password is obtained from the user. Every entry in the user
                #        file needs this password: `xxj31ZMTZzkVA'.
                #   o ExportCertData:
                #        This exports two additional environment variables: SSL_CLIENT_CERT and
                #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
                #        server (always existing) and the client (only existing when client
                #        authentication is used). This can be used to import the certificates
                #        into CGI scripts.
                #   o StdEnvVars:
                #        This exports the standard SSL/TLS related `SSL_*' environment variables.
                #        Per default this exportation is switched off for performance reasons,
                #        because the extraction step is an expensive operation and is usually
                #        useless for serving static content. So one usually enables the
                #        exportation for CGI and SSI requests only.
                #   o OptRenegotiate:
                #        This enables optimized SSL connection renegotiation handling when SSL
                #        directives are used in per-directory context.
                #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                #   SSL Protocol Adjustments:
                #   The safe and default but still SSL/TLS standard compliant shutdown
                #   approach is that mod_ssl sends the close notify alert but doesn't wait for
                #   the close notify alert from client. When you need a different shutdown
                #   approach you can use one of the following variables:
                #   o ssl-unclean-shutdown:
                #        This forces an unclean shutdown when the connection is closed, i.e. no
                #        SSL close notify alert is send or allowed to received.  This violates
                #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
                #        this when you receive I/O errors because of the standard approach where
                #        mod_ssl sends the close notify alert.
                #   o ssl-accurate-shutdown:
                #        This forces an accurate shutdown when the connection is closed, i.e. a
                #        SSL close notify alert is send and mod_ssl waits for the close notify
                #        alert of the client. This is 100% SSL/TLS standard compliant, but in
                #        practice often causes hanging connections with brain-dead browsers. Use
                #        this only for browsers where you know that their SSL implementation
                #        works correctly.
                #   Notice: Most problems of broken clients are also related to the HTTP
                #   keep-alive facility, so you usually additionally want to disable
                #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
                #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
                #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
                #   "force-response-1.0" for this.
                # BrowserMatch "MSIE [2-6]" \
                #               nokeepalive ssl-unclean-shutdown \
                #               downgrade-1.0 force-response-1.0

        </VirtualHost>
</IfModule>e variables "downgrade-1.0" and
                #   "force-response-1.0" for this.
                # BrowserMatch "MSIE [2-6]" \
                #               nokeepalive ssl-unclean-shutdown \
                #               downgrade-1.0 force-response-1.0

        </VirtualHost>
</IfModule>

I tried inserting the new actual Certbot SSL Certificate pointers to the above default file.
No change either !

Any ideas what's wrong ?

Or should I just wait for the www sub-domain A Record to propagate as an alias to the VPS IP address ?

Hello @tamjk welcome to the Let's Encrypt community. :slightly_smiling_face:

I am not having any issue on Windows 10 with Firefox 111.0.1 (64-bit) nor with Chrome Version 111.0.5563.111 (Official Build) (64-bit).

I suggest clearing the Cache on your web browser and close the web browser and restart it, then check again.
Site looks good from here SSL Server Test: sandbarsoftware.ie (Powered by Qualys SSL Labs)

1 Like

The site is reached properly when it's plain sandbarsoftware.ie

But when it's prefixed with www. - that's when the problems start.

Of course I flushed my cache, history, etc each time and restarted Apache2 also after edits to config files.

Oh, from here https://decoder.link/sslchecker/sandbarsoftware.ie/443 I see the SANs only has sandbarsoftware.ie and NOT www.sandbarsoftware.ie; I had only tested without the www.

2 Likes

Kindly wait for more knowledgeable Let's Encrypt community volunteers to assist.
Someone who knows Certbot (probably something like -d sandbarsoftware.ie -d www.sandbarsoftware.ie)

3 Likes

Okay, Bruce.

It's time too get out here now anyway ! :dancing_women:

2 Likes

@tamjk The actual command that you ran to obtain the Certificate is highly desired (needed), please!

3 Likes

@Bruce5051:

After running the preliminary commands:

$sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository universe
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt install certbot python3-certbot-apache

I then ran:


$  sudo certbot --apache

All this was done as per Ubuntu Linux Bible p.405-406.

I must note here that I have been using Firefox and Firefox Dev Ed as my test browsers.

Looking at the behaviour on both MS Edge and Chromium, I see no issues with these two browsers accepting the domain certificate's validity whenever the www. sub-domain of the domain is requested.

So it's a stricter interpretation of SSL certificate validity on the part of Firefox.
But nonetheless one that I have to find a way to satisfy.

2 Likes

Using the PPA is not recommended: it's not updated any longer. Please see https://certbot.eff.org/ for instructions for your system (probably using snapd).

Also, I recommend adding the www subdomain to the certificate even if some browsers will work without it. Strictly speaking it's necessary for proper validation.

4 Likes

I want to add it but do not see any obvious way to do so.
I was given just one domain option during certificate creation.
Is there a command to add other domains ?

Or should I just redo everything in the way you suggest ?

Certbot should be able to recognise the ServerAlias from the Apache configuration. But the PPA version of Certbot is probably quite old, it might contain bugs. I highly recommend to install the most recent Certbot and try again.

If that doesn't help:

Yes, you can use the -d option to manually specify domains. Please see User Guide — Certbot 2.4.0 documentation for the Certbot documentation.

Also please note that older versions of Certbot didn't always correctly recognise existing certificates which could be expanded, so please update Certbot also for this option. Otherwise you might end up with two certificates, one of which would not be used, but would automatically be renewed anyway for nothing.

4 Likes

How many are shown with?:
sudo apachectl -t -D DUMP_VHOSTS

4 Likes

The Certbot creation process just shows a dialogue something like this:


------------------------------
------------------------------
1. mysite.ext
-------------------------------
Please enter number(s) for sites to be added to the certificate:

Presumably it interacted with the /etc/apache2/sites-enabled folder and inferred from that what the sites to be covered by the certificate were.

I am presently reinstalling Apache2 and will then install Certbot according to the link provided above.

Sorry about long delay.
That damned Apache2 had missing dpkg bits and I had to reinstall the whole server again.

Anyways, all is well now.
Using the new Certbot procedure linked above by Osiris, the certificate creation dialogue listed

  1. mysite.xyz
  2. www.mysite.xyz

as available sites for coverage by the new certificate. Default selected all available sites/subsites for coverage.

$ sudo certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: sandbarsoftware.ie
    Serial Number: 38b1ade6114b41627a0dbe7cb713bd9a8e1
    Key Type: ECDSA
    Domains: sandbarsoftware.ie www.sandbarsoftware.ie
    Expiry Date: 2023-06-24 16:20:04+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/sandbarsoftware.ie/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/sandbarsoftware.ie/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Many thanks to all :pray:

3 Likes

Nice :slight_smile:

Please make sure sudo certbot certificates only shows the certificate you want and no (unused) duplicates.

5 Likes

Nice command, rg305: $ sudo apachectl -t -D DUMP_VHOSTS

$ sudo apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:443                  sandbarsoftware.ie (/etc/apache2/sites-enabled/sandbarsoftware.ie-le-ssl.conf:2)
*:80                   is a NameVirtualHost
         default server vps-f7db3388.vps.ovh.net (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost vps-f7db3388.vps.ovh.net (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost sandbarsoftware.ie (/etc/apache2/sites-enabled/sandbarsoftware.ie.conf:1)
                 alias www.sandbarsoftware.ie

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