I ran this command: lego --tls --email="my@email.com" --domains="monoviajero.com" --domains="www.monoviajero.com" --path="/opt/bitnami/letsencrypt" renew
It produced this output:
2019/12/02 20:37:36 [INFO] [monoviajero.com] acme: Trying renewal with -48 hours remaining
2019/12/02 20:37:36 [INFO] [monoviajero.com, www.monoviajero.com] acme: Obtaining bundled SAN certificate
2019/12/02 20:37:37 [INFO] [monoviajero.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1517197274
2019/12/02 20:37:37 [INFO] [www.monoviajero.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1517197275
2019/12/02 20:37:37 [INFO] [monoviajero.com] acme: use tls-alpn-01 solver
2019/12/02 20:37:37 [INFO] [www.monoviajero.com] acme: use tls-alpn-01 solver
2019/12/02 20:37:37 [INFO] [monoviajero.com] acme: Trying to solve TLS-ALPN-01
2019/12/02 20:37:43 [INFO] [www.monoviajero.com] acme: Trying to solve TLS-ALPN-01
2019/12/02 20:37:50 [INFO] Unable to deactivate the authorization: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1517197274
2019/12/02 20:37:50 [INFO] Unable to deactivate the authorization: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1517197275
2019/12/02 20:37:50 acme: Error -> One or more domains had a problem:
[monoviajero.com] acme: error: 400 :: urn:ietf:params:acme:error:connection :: Error getting validation data, url:
[www.monoviajero.com] acme: error: 400 :: urn:ietf:params:acme:error:connection :: Error getting validation data, url:
My web server is (include version):
Apache
I can login to a root shell on my machine (yes or no, or I don’t know):
yes
From provided links I can see the following errors:
I’m using AWS EC2 and I’m not sure if IPv6 is assigned. Anyway 2001:8d8:100f:f000::238 seems to be correct address.
Regarding Nginx response maybe your request was made just when lego is running because in my case the same requests obtain the following results (when Apache & Wordpress is running):
$ curl -X GET -I -6 http://monoviajero.com:443
HTTP/1.1 400 Bad Request
Date: Tue, 03 Dec 2019 21:10:18 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Content-Length: 362
Connection: close
Content-Type: text/html; charset=iso-8859-1
$ curl -X GET -I -6 http://monoviajero.com
HTTP/1.1 301 Moved Permanently
Date: Tue, 03 Dec 2019 21:10:48 GMT
Server: Apache
X-Powered-By: PHP/7.0.26
X-Redirect-By: WordPress
X-Frame-Options: SAMEORIGIN
Location: https://www.monoviajero.com/
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Any idea or some workaround ? I’m ok to revoke current certificate and generate new one but revoking also throws error:
$ sudo /opt/bitnami/letsencrypt/lego --tls --email="example@mail.com" --domains="monoviajero.com" --domains="www.monoviajero.com" --path="/opt/bitnami/letsencrypt" revoke
2019/12/03 21:20:23 Trying to revoke certificate for domain monoviajero.com
2019/12/03 21:20:23 Error while revoking the certificate for domain monoviajero.com
acme: error: 403 :: POST :: https://acme-v02.api.letsencrypt.org/acme/revoke-cert :: urn:ietf:params:acme:error:unauthorized :: Certificate is expired, url:
Creating new certificate with new email also throws same error:
$ sudo /opt/bitnami/letsencrypt/lego --tls --email="new@email.com" --domains="monoviajero.com" --domains="www.monoviajero.com" --path="/opt/bitnami/letsencrypt" run
2019/12/03 21:22:28 [INFO] [monoviajero.com, www.monoviajero.com] acme: Obtaining bundled SAN certificate
2019/12/03 21:22:28 [INFO] [monoviajero.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1533701636
2019/12/03 21:22:28 [INFO] [www.monoviajero.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1533701637
2019/12/03 21:22:28 [INFO] [monoviajero.com] acme: use tls-alpn-01 solver
2019/12/03 21:22:28 [INFO] [www.monoviajero.com] acme: use tls-alpn-01 solver
2019/12/03 21:22:28 [INFO] [monoviajero.com] acme: Trying to solve TLS-ALPN-01
2019/12/03 21:22:34 [INFO] [www.monoviajero.com] acme: Trying to solve TLS-ALPN-01
2019/12/03 21:22:41 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1533701636
2019/12/03 21:22:41 [INFO] Unable to deactivate the authorization: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1533701636
2019/12/03 21:22:41 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1533701637
2019/12/03 21:22:41 [INFO] Unable to deactivate the authorization: https://acme-v02.api.letsencrypt.org/acme/authz-v3/1533701637
2019/12/03 21:22:41 Could not obtain certificates:
acme: Error -> One or more domains had a problem:
[monoviajero.com] acme: error: 400 :: urn:ietf:params:acme:error:tls :: remote error: tls: internal error, url:
[www.monoviajero.com] acme: error: 400 :: urn:ietf:params:acme:error:connection :: Error getting validation data, url:
You have a right ! I just see here the following warning:
Fatal: Check of /.well-known/acme-challenge/random-filename has different answers checking ipv6 / ipv4.
Ipv6 doesn't have the expected result http status 404 - Not Found. Creating a Letsencrypt certificate via http-01 validation may not work.
Checking the validation file in /.well-known/acme-challenge Letsencrypt prefers ipv6. Two options: Remove your ipv6 / AAAA DNS entry or (better) fix your ipv6, so your webserver handles ipv6 correct.
Perhaps add "Listen [::]:80". Don't use <VirtualHost ip-address:80>, switch to <VirtualHost *:80>. If you use IIS, check your bindings.
Don't select a single ip address. Use this tool to check your raw ipv6 address. Add your domain name in the "Hostname" - field. Trouble creating a certificate? Use https://community.letsencrypt.org/ to ask.
Now I have removed AAAA record from DNS (managed by 1&1) and will try to renew certificate again.
You made my day !!! Finally the problem was with bad IPv6 AAAA record. Just after removing AAAA records from DNS, certificate renews without any problem.
As shown in warning that I posted before, LetsEncrypt prefers IPv6 instead IPv4.