Issue a certificate on vm with limited internet access

Hi, i have a task to issue a certificate on a virtual machine which is running Nginx but with limited internet access

My domain is:
vw.paslavskyit.club
I ran this command:
certbot --nginx
It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
An unexpected error occurred:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='acme-v02.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fed487177f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version):
Nginx 1.18 ubuntu
The operating system my web server runs on is (include version):
Ubuntu 22.04
My hosting provider, if applicable, is:
Self-hosted
I can login to a root shell on my machine (yes or no, or I don't know):
yes
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot 1.29.0

my iptables settings:
root@localhost:/etc/nginx/sites-enabled# iptables -S

-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT DROP
-N DOCKER
-N DOCKER-ISOLATION-STAGE-1
-N DOCKER-ISOLATION-STAGE-2
-N DOCKER-USER
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -d 172.16.0.0/12 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -m state --state NEW -j ACCEPT
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
-A FORWARD -o br-b667eec7c493 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o br-b667eec7c493 -j DOCKER
-A FORWARD -i br-b667eec7c493 ! -o br-b667eec7c493 -j ACCEPT
-A FORWARD -i br-b667eec7c493 -o br-b667eec7c493 -j ACCEPT
-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -d 51.68.162.62/32 -p tcp -m tcp --dport 587 -m state --state ESTABLISHED -j ACCEPT
-A OUTPUT -s 172.16.0.0/12 -j ACCEPT
-A DOCKER -d 172.19.0.2/32 ! -i br-b667eec7c493 -o br-b667eec7c493 -p tcp -m tcp --dport 80 -j ACCEPT
-A DOCKER-ISOLATION-STAGE-1 -i br-b667eec7c493 ! -o br-b667eec7c493 -j DOCKER-ISOLATION-STAGE-2
-A DOCKER-ISOLATION-STAGE-2 -o br-b667eec7c493 -j DROP
-A DOCKER-USER -j RETURN
1 Like

DNS resolving doesn't seem to work.

5 Likes

thanks, i've added new rule to allow udp 53 in iptables and now it works!

3 Likes

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