SSL Certificate generated through certbot now says "Certificate is not valid"

As a follow-up of this thread, the certificates that I had generated today using sudo certbot --apache now says Certificate is not Valid.

Screenshot from 2023-10-01 19-05-11

The certificate was installed and deployed without any issues as can be seen below.

snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot

root@ip-@@@-@@@-@@@-@@@:/home/ubuntu# sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: @@@@@.ddns.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Requesting a certificate for @@@@@.ddns.net

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/@@@@@.ddns.net/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/@@@@@.ddns.net/privkey.pem
This certificate expires on 2023-12-30.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for @@@@@.ddns.net to /etc/apache2/sites-available/000-default-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://@@@@@.ddns.net

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
root@ip-@@@@@-@@@@@-@@@@@-@@@@@:/home/ubuntu# apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:443                  @@@.@@@.@@@.@@@ (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:80                   @@@.@@@.@@@.@@@ (/etc/apache2/sites-enabled/000-default.conf:1)

But now every time I access the AWS EC2 Elastic IP, it gives me the message 'Certificate is not Valid`.
Also, when I try to access the domain @@@@.ddns.net, it says

Deceptive site ahead
Attackers on @@@.ddns.net may trick you into doing something dangerous like installing software or revealing your personal information (for example, passwords, phone numbers or credit cards).

I had tried clearing out browser history, cache, cookies. Tried accessing the site from my laptop, mobile but it gives me the same message. I am not really sure what's wrong here.

The certificate is fine. You need to use a URL for your domain name - not the IP address. Certificates are validated using public domain names. Use a site like this SSL Checker and you will see the cert and domain name it is valid for.

Note if you use the IP address as the hostname the validation will fail. If using your domain name it works fine.

By the way, you should have also been using the domain name as your ServerName in your Apache VirtualHosts. You either omitted them or used the IP address which is bad practice.

2 Likes

Looks like no issues.

Not sure why am I getting a Deceptive Site message when I access https://sandeepc.ddns.net/

That sounds like a google safe browsing message from chrome. You will need to research that with google. It is not related to your cert.

Social Engineering (Phishing und betrügerische Websites) | Google Search Central  |  Dokumentation  |  Google for Developers.

2 Likes

But this is not specific to Google Chrome. It gives me the same message on Firefox as well(for example) and on multiple devices as well(my laptop and on my mobile).

All I have on /var/www/html/ is an index.html file as below

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Site Maintenance</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f2f2f2;
            text-align: center;
            margin: 0;
            padding: 0;
        }

        .maintenance-container {
            background-color: #ffffff;
            max-width: 600px;
            margin: 100px auto;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        }

        h1 {
            color: #333;
        }

        p {
            color: #777;
        }

        .logo {
            width: 150px;
            height: 150px;
            margin: 20px auto;
            display: block;
        }
    </style>
</head>
<body>
    <div class="maintenance-container">
        <img src="https://i.imgur.com/Zyy5NYu.jpg" alt="Site Logo" class="logo">
        <h1>Site Under Maintenance</h1>
        <p>We apologize for the inconvenience, but our website is currently undergoing maintenance to improve your experience.</p>
        <p>Please check back later.</p>
    </div>
</body>
</html>

Firefox can or does also use Google Safe browsing. See Security/Safe Browsing - MozillaWiki.

From my point of view there's nothing wrong with your site. The certificate works as expected.

Edit: seems like Google Transparency Report does not mention anything. So either something is perhaps cached or another anti-malware thingy is marking the site as unsafe. Either way, still not a cert issue.

3 Likes

I see your site fine with Windows Edge and Firefox. Your site also gets an A grade on SSLLabs.

Check your browser security settings. Maybe check your router for security settings too. Check any firewalls you have.

In any case, this is not related to your Let's Encrypt certs.

3 Likes

Okay. Thank you @Osiris for your feedback.

1 Like

Okay. Thanks so much @MikeMcQ.

I think the problem could be because my site is a subdomain of ddns.net. But yes, it seems it may not be a Let's Encrypt issue.

1 Like

Some kind of security software seems to think along this way. It shouldn't work like this for Google safe browsing.

There are cheap domain names (think $1-2 per year) if a domain name that looks like a phone number is ok :smiley:

7-10 digits .xyz, pay attention and compare your registrars. They're definitely not all the same.

2 Likes

The site again works fine. I have no clue what went wrong.

Sticking with free ddns.net subdomain for the time being. :slightly_smiling_face::+1:

2 Likes

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