Unable to generate SSL

My domain is: api.smartaihr.com

I ran this command : sudo certbot --apache -d api.smartaihr.com -d www.api.smartaihr.com -v

It produced this output :
Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority
reported these problems:
Domain: api.smartaihr.com
Type: unauthorized
Detail: 2a02:4780:b:1268:0:1ece:1480:10: Invalid response from http://api.smartaihr.com/.well-
known/acme-challenge/zA6uk4EpgM1ASG137Ocs1B1Q2Tcr9V9gtevMwvj2f8Y: 404

My web server is (include version):using apache2

The operating system my web server runs on is (include version):ubuntu

i have already installed ssl for only www.api.smartaihr.com but i need to install api.smartaihr.com as well

my config file looks like this
<VirtualHost *:80>
ServerName api.smartaihr.com
ServerAlias www.api.smartaihr.com

DocumentRoot /var/www/smartaihr

ProxyPreserveHost On

# Allow Let's Encrypt to verify ownership
Alias /.well-known/acme-challenge/ /var/www/smartaihr/.well-known/acme-challenge/

<Directory "/var/www/smartaihr/.well-known/acme-challenge/">
    Options None
    AllowOverride None
    Require all granted
</Directory>

# Redirect all other traffic to HTTPS (after Certbot completes)
 RewriteEngine On
 RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

all other spec are working fine i am running a jar file so can someone help with this ? thanks

Welcome @venkatakrishna143

You have both an IPv4 A record and an IPv6 AAAA record in your DNS just for your api domain name

But, the IPv6 address points to a Hostinger service not your server. Hostinger creates this AAAA record automatically for new setups.

You need to update the AAAA address or remove it if you do not support IPv6.

Any client trying to use IPv6 will connect to that Hostinger service instead of your server.
Let's Encrypt favors IPv6 when an AAAA record is present.

See Hostinger article here: How to manage AAAA records | Hostinger Help Center

And use this site to test connections
https://letsdebug.net

4 Likes

you are right after removing it I am able to installed thanks for your support

4 Likes

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