Letsencrypt - acme: error: 400 - Error getting validation data

I have a current staging cert for dev.oversightcloud.com and the cert has only one SAN: dev.oversightcloud.com

I am trying to renew this cert and add these two hostnames to the SAN: dev1.oversightcloud.com and dev2.oversightcloud.com

dev1.oversightcloud.com has address 35.232.76.9
dev.oversightcloud.com has address 35.232.76.9
dev2.oversightcloud.com has address 34.122.41.210

When I run this command:

/opt/bitnami/letsencrypt/lego --tls --email="me@xyz.com" --server=https://acme-staging-v02.api.letsencrypt.org/directory --domains="dev.oversightcloud.com" --domains="dev1.oversightcloud.com" --domains="dev2.oversightcloud.com" --path="/opt/bitnami/letsencrypt" renew --days 90

I get these errors:

2024/10/05 11:26:21 [INFO] [dev.oversightcloud.com] acme: Trying renewal with 2066 hours remaining
2024/10/05 11:26:21 [INFO] [dev.oversightcloud.com, dev1.oversightcloud.com, dev2.oversightcloud.com] acme: Obtaining bundled SAN certificate
2024/10/05 11:26:21 [INFO] [dev.oversightcloud.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/xxx73
2024/10/05 11:26:21 [INFO] [dev1.oversightcloud.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/xxx83
2024/10/05 11:26:21 [INFO] [dev2.oversightcloud.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/xxx93
2024/10/05 11:26:21 [INFO] [dev.oversightcloud.com] acme: use tls-alpn-01 solver
2024/10/05 11:26:21 [INFO] [dev1.oversightcloud.com] acme: use tls-alpn-01 solver
2024/10/05 11:26:21 [INFO] [dev2.oversightcloud.com] acme: use tls-alpn-01 solver
2024/10/05 11:26:21 [INFO] [dev.oversightcloud.com] acme: Trying to solve TLS-ALPN-01
2024/10/05 11:26:24 [INFO] [dev.oversightcloud.com] The server validated our request
2024/10/05 11:26:24 [INFO] [dev1.oversightcloud.com] acme: Trying to solve TLS-ALPN-01
2024/10/05 11:26:26 http: TLS handshake error from 13.213.42.255:46326: EOF
2024/10/05 11:26:28 [INFO] [dev1.oversightcloud.com] The server validated our request
2024/10/05 11:26:28 [INFO] [dev2.oversightcloud.com] acme: Trying to solve TLS-ALPN-01
2024/10/05 11:26:33 [INFO] Skipping deactivating of valid auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/xxx73
2024/10/05 11:26:33 [INFO] Skipping deactivating of valid auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/xxx83
2024/10/05 11:26:33 [INFO] Deactivating auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/xxx93
2024/10/05 11:26:33 error: one or more domains had a problem:
[dev2.oversightcloud.com] acme: error: 400 :: urn:ietf:params:acme:error:connection :: 34.122.41.210: Error getting validation data

From server where I am running this I can get to all 3 hostnames:

# curl http://dev.oversightcloud.com
<!DOCTYPE html>
# curl http://dev1.oversightcloud.com
<!DOCTYPE html>
# curl http://dev2.oversightcloud.com
<!DOCTYPE html>
1 Like

Hmm sorry about the formatting of my post. This is my first post here and I don't see anyway to edit my post :frowning:
Any way, what did not show up in my post is that all 3 curl commands were able to successfully connect.

1 Like

No worries. I even fixed the couple parts you had not yet.

Anyway, the problem is the 2 different IP addresses for your domains. Lego needs to prepare both of your servers so they can reply successfully to Let's Encrypt authentication server. You can see in the log that dev and dev1 worked as that is where lego is. But, dev2 failed.

I don't know lego very well and maybe there is a way to have it setup a "remote" server too. Usually you run an ACME Client on each server. So, one on your dev and dev1 machine and another on dev2.

Another option is the DNS Challenge. You can get a cert from a single machine that covers any domain name you control. You can even get a wildcard cert. If you run lego on dev1 you still need to copy the resulting cert to dev2. So, maybe just easier to run lego on each?

Oh, and welcome to the community @tacoma50

2 Likes

While I admint I too don't know much about lego, it seems OP is using the tls-alpn-01 challenge. And while theoretically it wouldn't be impossible to expedite this challenge to other servers, practically I don't think it's possible.

The http-01 challenge is probably much easier to do this with.

Yeah, I don't know lego well enough to describe multi-server challenges - http or tls-alpn.

Even if that is possible, retaining TLS-ALPN and running lego on each machine even easier :slight_smile:

Just looking and see Hover as DNS provider. I don't think they offer an API to allow automating the DNS Challenge. Two lego much better than manual DNS Challenge (almost always).

3 Likes

Certainly!

2 Likes

Hi Everyone

Thank you for the great replies! Now that I understand what the issue is, I need to state what my ultimate need will be.

Eventually I will need one cert that I will place on two servers called dev and dev2.

The cert will need to contain these 3 SAN hostnames:

devLB.oversightcloud.com has address 35.232.76.55
dev1.oversightcloud.com has address 35.232.76.9
dev2.oversightcloud.com has address 34.122.41.210

So all 3 host names will resolve to a different IP address.

The devLB hostname will be an address that a level-4 load balancer network device will be listening on, sending any of that traffic to either dev1 or dev2. So there will be no devLB server to run any ACME client commands on.

What is the easiest way to accomplish this via letsencrypt by using lego or some other ACME client?

I am not locked into using lego, but maybe there is a way to use lego by choosing a different challenge method? How would that command look?

What is there another ACME client tool that could easily handle this type of cert request? Do you have an example?

1 Like

By using a DNS Challenge. You can run that on any machine and just distribute the certs as needed.

For now you would be limited to using a manual option as I am nearly certain Hover does not support an API that would allow automated renewals.

For that you should switch DNS providers. Cloudflare is very commonly used although there are certainly others. Just make sure lego or whatever ACME Client you choose also supports that new DNS provider.

The lego manual option is described here. Also see the general lego CLI page and all the --dns related options

3 Likes

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