Error 404 unauthorized, cannot add certificate

So I am trying to add a certificate to my website and I keep failing. Here are a few details that might help with the investigation:

  • the domain is Originally the domain was hosted by and it had an SSL certificate. You can see it here , if it helps: |
  • the server is Ubuntu 22.04 and I have root access
  • I started to move the domain to a VPS still hosted by Hostinger. I am using Apache.
  • I moved some of the files to VPS, now I can access the site using I also deleted the old certificate, hoping that this will allow me to create a new one
  • I tried to install the certificate using directions from here: How to Install SSL on VPS Using Certbot | Hostinger Help Center
  • it kept failing with error 404
  • so I decided to install it manually, because I thought that I can better understand the process.
  • I ran "sudo certbot certonly --manual", I created a file with the name required, I placed the text in the content of the file, and I made the file available at that address. I was able to open and view the content of the file
  • but the certificate was not installed, and I got this error:
    Certbot failed to authenticate some domains (authenticator: manual). The Certificate Authority reported these problems:
    Type: unauthorized
    Detail: 2a02:4780:b:664:0:2c25:8fd8:1: Invalid response from 404
    Hint: The Certificate Authority failed to verify the manually created challenge files. Ensure that you created these in the correct location.
    Some challenges have failed.
    Ask for help or search for solutions at See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
  • I do not know what else I can try, because I do not know what I am doing wrong. I am not an expert with Linux, nor with Apache. It I got this far it was only because I tried a lot, and eventually something worked. Now I am stuck. Do you have any hints about what else I can try ?

Hi @cbanana, and welcome to the LE community forum :slight_smile:

I found those two things stood out [to me].

For the first: Please show us the output of:
sudo apachectl -t -D DUMP_VHOSTS

For the last: Does your site [] work via IPv6?
The IPv4 and IPv6 seem to be handled by two different systems:

curl -Ii4
HTTP/1.1 200 OK
Date: Fri, 15 Dec 2023 17:45:35 GMT
Server: Apache/2.4.52 (Ubuntu)     <<<<<<<<<<<<<<<<<<<<<<<<<
Last-Modified: Sat, 18 Nov 2023 17:32:16 GMT
ETag: "12c2-60a70a24f8800"
Accept-Ranges: bytes
Content-Length: 4802
Vary: Accept-Encoding
Content-Type: text/html
curl -Ii6
HTTP/1.1 200 OK
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
content-type: text/html
last-modified: Sat, 23 Apr 2022 14:17:29 GMT
etag: "126d-62640a79-76ffc30d83d0599e;;;"
accept-ranges: bytes
content-length: 4717
date: Fri, 15 Dec 2023 17:45:39 GMT
server: LiteSpeed     <<<<<<<<<<<<<<<<<<<<<<<<<
platform: hostinger     <<<<<<<<<<<<<<<<<<<<<<<<<

Here is the result for that command:
VirtualHost configuration:
*:80 is a NameVirtualHost
default server (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost (/etc/apache2/sites-enabled/codexbanana.conf:1)

It is possible that IPv4 and IPv6 are handled by two different systems. I tried to manually move the site, and host it on a VPS. It is very possible that I forgot something. Although the site appears to work, it is possible that there are some issues, as you noticed. Let me investigate the IPv4 and IPv6.

Did you "test" access from a system with IPv6?


I do not know how to test access from a system with IPv6. But I got a to website that gave me this result:

DNS (IPv6 NS) PASS Hostname does have IPv6-addressed nameservers defined.
DNS (IPv6 TLD NS) PASS Hostname top-level domain (com.) does have IPv6-addressed nameservers defined.
DNS (IPv4 A Record) PASS Hostname does have an IPv4 A record (
DNS (IPv6 AAAA Record) PASS Hostname does have an IPv6 AAAA record (2a02:4780:b:664:0:2c25:8fd8:1).
DNS (MX Record) FAIL Hostname does not have an MX with an AAAA record.
DNS (Glue) PASS Glue does not appear to be needed; nameserver configuration for is not self-referencing.
IPv4 Connectivity PASS Successfully connected to on port 80 over IPv4.
IPv6 Connectivity PASS Successfully connected to on port 80 over IPv6.
IPv4 Literals WARN Could not establish connection to URL

for the DNS , I changed to this new value:
AAAA @ 0 2a02:4780:10:5ff8::1
I took the IPV6 from VPS, so I hope it works.
Do I need to wait to replicate now ?

I ran again the same commands you executed earlier (curl -Ii6 and -Ii4) and now both appear to point to the same server.

I tried again the manual installation and it worked. I got the message "Successfully received certificate". So the problem was that my VPS IPv4 and IPv6 were pointing to different addresses. Once I corrected the Ipv6 , the certificate was installed :-))) Thank you very much. I would have never figure it out what was wrong. Now I am trying to determine why does not open.


Here is a clue:

curl -Ii
curl: (35) error:0A000438:SSL routines::tlsv1 alert internal error
curl -Ii
HTTP/1.0 301 Moved Permanently
Cache-Control: private, no-cache, max-age=0
Pragma: no-cache
Content-Length: 0
Connection: Close

I had to remove the default config files, because they were taking some ports (443). After I deleted 2 files from /etc/apache2/sites-available/ and restarted Apache, I was finally able to open my side using https. I am all set, thanks a lot !!!

1 Like

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