Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
time="2023-06-21T06:52:28Z" level=error msg="Unable to obtain ACME certificate for domains \"portainer.carlosgrillet.me\": unable to generate a certificate for the domains [portainer.carlosgrillet.me]: error: one or more domains had a problem:\n[portainer.carlosgrillet.me] acme: error: 400 :: urn:ietf:params:acme:error:connection :: 170.187.144.237: Connection refused\n" ACME CA="https://acme-v02.api.letsencrypt.org/directory" routerName=portainer@docker rule="Host(portainer.carlosgrillet.me)" providerName=letsEncrypt.acme
My web server is (include version): traefik container 2.10.3
The operating system my web server runs on is (include version): ubuntu 22.04
My hosting provider, if applicable, is: Linode
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
reading from previous threads, I noticed that letsEncrypt can block IPs, can you please check my pulbic IP? 170.187.144.237. Thank you for your time
Thanks. Proves you can reach the Let's Encrypt server so your IP is not blocked. I don't know enough about your traefik setup to help debug. You might find better help debugging the comms problem on the traefik community forum.
quick update. I tested using the same container but in other server with other public IP, and works well. Something that calls my attention is that in the error message says "connection refused"
time="2023-06-21T23:08:16Z" level=error msg="Unable to obtain ACME certificate for domains "docker.carlosgrillet.me": unable to generate a certificate for the domains [docker.carlosgrillet.me]: error: one or more domains had a problem:\n[docker.carlosgrillet.me] acme: error: 400 :: urn:ietf:params:acme:error:connection :: 170.187.144.237: Connection refused\n" routerName=portainer@docker rule="Host(docker.carlosgrillet.me)" providerName=letsEncrypt.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory"
I even tryed to change the subdomain from portainer to docker, but still nothing. The other server that I tested had the public ip 200.8.184.52 and worked fine. I just copied the config from one to another.
Yes, the connection refused is a comms problem as I noted. You should look at other differences between the servers that work and fail to see if there's any communications config that is different. You should focus on what might be different between the environment you ran the curl command and the one in which the Acme client runs
@carlosgrillet I may have led you astray. The format of the message and your concern about IP being blocked made me think the problem was with the outbound connection from your container.
But, I just looked again and it looks like an inbound problem to your server. It is still some sort of config problem in your system. And, I don't know your overall system well enough to advise. But, if I try to send a test HTTP Challenge request to your domain(s) I get a "connection refused".
This is at least partly because you redirect the HTTP request to HTTPS and nothing is listening on port 443 to process that request. It is best to not redirect the ACME Challenge HTTP request
Note the below happens with the docker subdomain and your apex domain. You showed both at different times.
curl -i http://docker.carlosgrillet.me/.well-known/acme-challenge/Test123
HTTP/1.1 301 Moved Permanently
Location: https://docker.carlosgrillet.me/.well-known/acme-challenge/Test123
curl -i https://docker.carlosgrillet.me/.well-known/acme-challenge/Test123
curl: (7) Failed to connect to docker.carlosgrillet.me port 443 after 15 ms: Connection refused
nmap -p80,443 docker.carlosgrillet.me
rDNS record for 170.187.144.237: 170-187-144-237.ip.linodeusercontent.com
PORT STATE SERVICE
80/tcp open http
443/tcp closed https
Thank you again for your time. Now its really clear for me. I will re-check all the configuration again. Just for you to know in both server I have this reverse proxy configuration: