Error de DNS y registros al generar certificado

Hola, Monte un Servidor de Correo Zimbra 9, y el correo funciona bien, envia y recibe a correos externos, por lo que verifique y los registros DNS los veo correctamente y no encuentro el problema. Al generar el Certificado, da el siguiente error:

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.

Por favor, complete los campos del siguiente formulario para que podamos ayudarle de la mejor forma posible. Nota: debe proporcionar su nombre de dominio para obtener ayuda. Los nombres de dominio de los certificados emitidos se hacen públicos en los registros de Transparencia de Certificados (por ejemplo, crt.sh | example.com), por lo que esconder aquí su nombre de dominio no sirve de nada, únicamente nos dificulta prestarle la ayuda solicitada.

Puedo leer las respuestas en Inglés (sí o no): si

Mi dominio es: enlacesystem.com.py
Subdominio: mail.enlacesystem.com.py

Ejecuté este comando:
docker run -it --rm -p 443:443 -v /opt/docker/certbot:/etc/letsencrypt certbot/certbot certonly --standalone --email admin@enlacesystem.com.py --agree-tos -d mail.enlacesystem.com.py --no-eff-email

Produjo esta salida:
root@mail:/opt/docker/certbot# bash -x ./create-cert.sh
++ pwd

  • docker run -it --rm -p 443:443 -v /opt/docker/certbot:/etc/letsencrypt certbot/certbot certonly --standalone --email admin@enlacesystem.com.py --agree-tos -d mail.enlacesystem.com.py --no-eff-email
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator standalone, Installer None
    Requesting a certificate for mail.enlacesystem.com.py
    Performing the following challenges:
    http-01 challenge for mail.enlacesystem.com.py
    Waiting for verification...
    Challenge failed for domain mail.enlacesystem.com.py
    http-01 challenge for mail.enlacesystem.com.py
    Cleaning up challenges
    Some challenges have failed.

IMPORTANT NOTES:

Mi servidor web es (incluya la versión):
Zimbra 9 Collaboration

El sistema operativo en el que se ejecuta mi servidor web es (incluya la versión):
Ubuntu 18.04 LTS

Mi proveedor de alojamiento web (si aplica) es:

Puedo iniciar una sesión en una shell root en mi servidor (sí, no o no lo sé): si

Estoy usando un panel de control para administrar mi sitio (no o proporcione el nombre y la versión del panel de control): no

La versión de mi cliente es (por ejemplo, si usa certbot, muestre la salida de certbot --version o certbot-auto --version):
certbot 0.27.0
Docker version 19.03.6, build 369ce74a3c
Con ambos probe y da el mismo resultado.

El Ultimo comando que probe con el mismo resultado es: (en un script create-cert.sh)
docker run -it --rm
-p 443:443
-v $(pwd):/etc/letsencrypt
certbot/certbot
certonly --standalone
--email admin@enlacesystem.com.py --agree-tos
-d mail.enlacesystem.com.py
--no-eff-email

Salida de: bash -x ./create-cert.sh

root@mail:/opt/docker/certbot# bash -x ./create-cert.sh
++ pwd

  • docker run -it --rm -p 443:443 -v /opt/docker/certbot:/etc/letsencrypt certbot/certbot certonly --standalone --email admin@enlacesystem.com.py --agree-tos -d mail.enlacesystem.com.py --no-eff-email
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator standalone, Installer None
    Requesting a certificate for mail.enlacesystem.com.py
    Performing the following challenges:
    http-01 challenge for mail.enlacesystem.com.py
    Waiting for verification...
    Challenge failed for domain mail.enlacesystem.com.py
    http-01 challenge for mail.enlacesystem.com.py
    Cleaning up challenges
    Some challenges have failed.

IMPORTANT NOTES:

Resultado de: dig a enlacesystem.com.py

; <<>> DiG 9.11.3-1ubuntu1.14-Ubuntu <<>> a enlacesystem.com.py
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58807
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;enlacesystem.com.py. IN A

;; ANSWER SECTION:
enlacesystem.com.py. 0 IN A 192.168.100.251

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Feb 25 16:53:52 UTC 2021
;; MSG SIZE rcvd: 53

Resultado de: dig a mail.enlacesystem.com.py

; <<>> DiG 9.11.3-1ubuntu1.14-Ubuntu <<>> a mail.enlacesystem.com.py
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51389
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mail.enlacesystem.com.py. IN A

;; ANSWER SECTION:
mail.enlacesystem.com.py. 0 IN A 192.168.100.251

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Feb 25 16:55:24 UTC 2021
;; MSG SIZE rcvd: 69

Resultado de: dig MX enlacesystem.com.py

; <<>> DiG 9.11.3-1ubuntu1.14-Ubuntu <<>> MX enlacesystem.com.py
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22643
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;enlacesystem.com.py. IN MX

;; ANSWER SECTION:
enlacesystem.com.py. 0 IN MX 0 mail.enlacesystem.com.py.

;; ADDITIONAL SECTION:
mail.enlacesystem.com.py. 0 IN A 192.168.100.251

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Feb 25 16:54:46 UTC 2021
;; MSG SIZE rcvd: 104

Porfavor si pudieran darme algo de luz....

Hi @marceloroig80

if you use standalone, Certbot starts a new webserver (port 80), so Letsencrypt is able to validate port 80 of that webserver.

But checking /.well-known/acme-challenge/random-filename, there answers a LiteSpeed.

So

  • looks like your network / router configuration is wrong
  • the started standalone webserver is ignored / doesn't answer

Or your docker setup is wrong.

I think the 443:443 mapping may explain the problem that @JuergenAuer pointed out. That is, --standalone needs to use port 80 (temporarily, during the certificate issuance or renewal, to prove your control over the domain name), but you only let the Docker container where it was running use port 443.

Gracias por la rapida respuesta, voy a verificar el redireccionamiento del puerto en el router.

para explicar un poco mas como tengo montado mi infraestructura:
Tengo un Servidor Web en la ip local 192.168.100.250 que funciona bien y ya tiene su certificado Lets Encrypt el cual inicia con el dominio principal: enlacesystem.com.py,
Otro Servidor para el Correo con ip 192.168.100.251 que corre Zimbra el cual ingreso con con el puerto 3000 y en la URL aparece así: mail.enlacesystem.com.py:3000. De esta manera puedo acceder al Correo sin problemas. Pero claro el puerto 80 esta redireccionado al Primer Servidor que es WEB.

En el Router tengo configurado el Port Forwarding redireccionado de esta manera:
Puertos 80 y 443 al 192.168.100.250 - Servidor Web
Puertos 3000:443... otros de correo - Servidor Zimbra

Como podría solucionar eso en este caso?
podria redireccionar el Puertos 8080:80 y usar para mi propósito?

@marceloroig80, the certificate authority has to check your control over the domain name for the certificate you requested. There are industry rules that limit the ways that this can be done.

Let's Encrypt has currently chosen only three options:

In order to get a certificate, you have to use one of these three options. It's challenging to use the HTTP-01 option (which you're currently trying to use) with multiple servers behind a single IP address, since port 80 can generally only be forwarded to one of the servers at a time!

Some of the possibilities include:

  • Use the DNS-01 challenge type instead. In this case you would need a DNS API to update DNS records from software, if you want the certificate renewals to be automated (because a new DNS TXT record would have to be posted every time.)

  • Use a reverse proxy configuration to allow HTTP requests under /.well-known/acme-challenge to be answered by multiple servers behind the same router (so that the requests will succeed if any of the servers can satisfy them).

  • Obtain all of your certificates for all subdomains on the web server, even though it isn't intended to serve all of the subdomains. Then copy the certificates and keys from the web server onto the other machines and install them there. (This process could be automated with a script, for example using Certbot's --deploy-hook option, which runs a script to "deploy" new certificates after they have been obtained.)

Still another option is a technique sometimes called "remote webroot", meaning "allow the second server to create files under /.well-known/acme-challenge on the web server somehow"; in that case the second server would be able to make the HTTP-01 challenge succeed (by creating these files with the appropriate names and locations).

Hice la redirección en el router del puerto 3000 al 443 y del 8080 al 80 de mi Servidor de Correo, e intente lo siguiente:

docker run -it --rm -p 8080:80 -p 3000:443 -v /opt/docker/certbot:/etc/letsencrypt certbot/certbot certonly --standalone --email admin@enlacesystem.com.py --agree-tos -d mail.enlacesystem.com.py --no-eff-email

pero obtuve el mismo resultado...

voy a intentar hacer el proxy inverso, entiendo que debo configurarlo en los archivos del DNS de mi primer Servidor, utilizo CyberPanel como Servidro Web Principal.

Tienes alguna idea de como podría hacerlo sin complicarme mucho?

investigare un poco mas.

I don't know how docker works.

But external port 80 is required. Is that an external 80 or external 8080? If 8080, that can't work.

1 Like

El puerto 8080 es externo y el 80 es interno del Serv de Correo,
lo mismo para el 3000 es externo y 443 el interno, pero me esta dando este error:

docker: Error response from daemon: driver failed programming external connectivity on endpoint modest_booth (1c85aa1fc3005527e404f6d0352e474b3802d9c3f0ac4e86706cbd0c9e788ec4): Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already in use

Then you have to use 80:internalPort, not 8080:internalPort.

Letsencrypt starts checking port 80.

Efectivamente, no se puede Certificar con un puerto diferente que no sea el 80 y 443,
he probado poner el Servidor de Correo publicado directo en esos puertos y ha funcionado, logre Certificar.... y confirme el error....

Gracias por su Ayuda!!!!! son unos Capos!!!!

Ahora investigare sobre el proxy inverso, esa seria una solución para múltiples Servidores.

3 Likes

I'm glad it worked! I hope you can find a solution in the future (whether it's reverse proxy, DNS challenge, remote webroot, or any other solution) that will allow the renewals to be automated instead of manual.