go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.91k stars 1.02k forks source link

Add DNS provider for mijn.host #2252

Closed ldez closed 1 month ago

ldez commented 1 month ago

Ping @shubhamku044, can you run the command (with your domain, email, and credentials)?

-> https://github.com/go-acme/lego/pull/2252#issuecomment-2316726444

Closes #2251

mijnhost commented 1 month ago

I think name should be mijn.host, not just mijn. As it's means "my" but in Dutch. If a dot is not supported, perhaps one word or with a space in between.

shubhamku044 commented 1 month ago

I think name should be mijn.host, not just mijn. As it's means "my" but in Dutch. If a dot is not supported, perhaps one word or with a space in between.

yes @ldez, the name should be mijn.host instead of mijn

ldez commented 1 month ago

@egogo-nl I updated the implementation and the issue description, feel free to test this PR.

ldez commented 1 month ago

It is surprising that several users of a currently unsupported provider arrive so quickly on a PR freshly opened, so I assume, and this is only an assumption, this is linked to a particular need of a company.

So, sponsoring is a good way to sustain open-source maintainers: sponsor me

shubhamku044 commented 1 month ago

When I ran the command, I got the below output

Click to view the output ``` 2024/08/28 21:30:08 No key found for account shubhamku@044.com. Generating a P256 key. 2024/08/28 21:30:08 Saved key to /Users/shubhamkumar/Developer/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/shubhamku@044.com/keys/shubhamku@044.com.key 2024/08/28 21:30:10 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf Do you accept the TOS? Y/n Y 2024/08/28 21:30:14 [INFO] acme: Registering account for shubhamku@044.com !!!! HEADS UP !!!! Your account credentials have been saved in your Let's Encrypt configuration directory at "/Users/shubhamkumar/Developer/lego/.lego/accounts". You should make a secure backup of this folder now. This configuration directory will also contain certificates and private keys obtained from Let's Encrypt so making regular backups of this folder is ideal. 2024/08/28 21:30:14 [INFO] [*.testdomein12345.nl, testdomein12345.nl] acme: Obtaining bundled SAN certificate 2024/08/28 21:30:16 [INFO] [*.testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253133 2024/08/28 21:30:16 [INFO] [testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253143 2024/08/28 21:30:16 [INFO] [*.testdomein12345.nl] acme: use dns-01 solver 2024/08/28 21:30:16 [INFO] [testdomein12345.nl] acme: Could not find solver for: tls-alpn-01 2024/08/28 21:30:16 [INFO] [testdomein12345.nl] acme: Could not find solver for: http-01 2024/08/28 21:30:16 [INFO] [testdomein12345.nl] acme: use dns-01 solver 2024/08/28 21:30:16 [INFO] [*.testdomein12345.nl] acme: Preparing to solve DNS-01 2024/08/28 21:30:27 [INFO] [testdomein12345.nl] acme: Preparing to solve DNS-01 2024/08/28 21:30:38 [INFO] [*.testdomein12345.nl] acme: Trying to solve DNS-01 2024/08/28 21:30:39 [INFO] [*.testdomein12345.nl] acme: Checking DNS record propagation. [nameservers=8.8.8.8:53,4.2.2.2:53] 2024/08/28 21:30:41 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s] 2024/08/28 21:30:45 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:30:49 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:30:54 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:30:59 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:31:01 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:31:04 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:31:08 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:31:10 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:31:13 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/28 21:31:24 [INFO] [*.testdomein12345.nl] The server validated our request 2024/08/28 21:31:24 [INFO] [*.testdomein12345.nl] acme: Cleaning DNS-01 challenge 2024/08/28 21:31:34 [INFO] [testdomein12345.nl] acme: Cleaning DNS-01 challenge 2024/08/28 21:31:44 [INFO] Skipping deactivating of valid auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253133 2024/08/28 21:31:44 [INFO] Deactivating auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253143 2024/08/28 21:31:44 Could not obtain certificates: error: one or more domains had a problem: [testdomein12345.nl] [testdomein12345.nl] acme: error presenting token: mijnhost: update records: 400: Duplicate RRset _acme-challenge.testdomein12345.nl. IN TXT with changetype: REPLACE ```
ldez commented 1 month ago

mijnhost: update records: 400: Duplicate RRset _acme-challenge.testdomein12345.nl. IN TXT with changetype: REPLACE

I guess that mijn.host doesn't support multiple TXT records for the same domain, so I will use a sequential approach.

ldez commented 1 month ago

I updated the PR, can you try again?

shubhamku044 commented 1 month ago

I tried it again.

Click here to see the output ``` 2024/08/29 10:12:36 No key found for account shubhamku@044.com. Generating a P256 key. 2024/08/29 10:12:36 Saved key to /Users/shubhamkumar/Developer/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/shubhamku@044.com/keys/shubhamku@044.com.key 2024/08/29 10:12:38 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf Do you accept the TOS? Y/n Y 2024/08/29 10:12:41 [INFO] acme: Registering account for shubhamku@044.com !!!! HEADS UP !!!! Your account credentials have been saved in your Let's Encrypt configuration directory at "/Users/shubhamkumar/Developer/lego/.lego/accounts". You should make a secure backup of this folder now. This configuration directory will also contain certificates and private keys obtained from Let's Encrypt so making regular backups of this folder is ideal. 2024/08/29 10:12:42 [INFO] [*.testdomein12345.nl, testdomein12345.nl] acme: Obtaining bundled SAN certificate 2024/08/29 10:12:43 [INFO] [*.testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13780754553 2024/08/29 10:12:43 [INFO] [testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13780754563 2024/08/29 10:12:43 [INFO] [*.testdomein12345.nl] acme: use dns-01 solver 2024/08/29 10:12:43 [INFO] [testdomein12345.nl] acme: Could not find solver for: tls-alpn-01 2024/08/29 10:12:43 [INFO] [testdomein12345.nl] acme: Could not find solver for: http-01 2024/08/29 10:12:43 [INFO] [testdomein12345.nl] acme: use dns-01 solver 2024/08/29 10:12:43 [INFO] [*.testdomein12345.nl] acme: Preparing to solve DNS-01 2024/08/29 10:12:55 [INFO] [*.testdomein12345.nl] acme: Trying to solve DNS-01 2024/08/29 10:12:56 [INFO] [*.testdomein12345.nl] acme: Checking DNS record propagation. [nameservers=8.8.8.8:53,4.2.2.2:53] 2024/08/29 10:12:58 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s] 2024/08/29 10:13:05 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:08 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:12 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:16 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:19 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:22 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:26 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:29 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:42 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:45 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:13:48 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:14:00 [INFO] [*.testdomein12345.nl] The server validated our request 2024/08/29 10:14:00 [INFO] [*.testdomein12345.nl] acme: Cleaning DNS-01 challenge 2024/08/29 10:14:12 [INFO] sequence: wait for 1m0s 2024/08/29 10:15:12 [INFO] [testdomein12345.nl] acme: Preparing to solve DNS-01 2024/08/29 10:15:23 [INFO] [testdomein12345.nl] acme: Trying to solve DNS-01 2024/08/29 10:15:23 [INFO] [testdomein12345.nl] acme: Checking DNS record propagation. [nameservers=8.8.8.8:53,4.2.2.2:53] 2024/08/29 10:15:25 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s] 2024/08/29 10:15:26 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:28 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:32 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:35 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:38 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:40 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:43 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:46 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:49 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:52 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:15:55 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:00 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:02 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:05 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:07 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:10 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:13 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:15 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:20 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:22 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation. 2024/08/29 10:16:32 [INFO] [testdomein12345.nl] The server validated our request 2024/08/29 10:16:32 [INFO] [testdomein12345.nl] acme: Cleaning DNS-01 challenge 2024/08/29 10:16:42 [INFO] [*.testdomein12345.nl, testdomein12345.nl] acme: Validations succeeded; requesting certificates 2024/08/29 10:16:43 [INFO] Wait for certificate [timeout: 30s, interval: 500ms] 2024/08/29 10:16:45 [INFO] [*.testdomein12345.nl] Server responded with a certificate. ```
ldez commented 1 month ago

So it's working.

I will just reduce the sequence interval.

dmke commented 1 month ago

(Will review later, when the current heat wave has passed a bit. Superficially, this looks OK.)

mijnhost commented 1 month ago

Thank you both. @ldez Are you willing to release a new version soon? We would like to become compatible with Traefik.

ldez commented 1 month ago

I will merge some PRs before creating a release (so in a few days), after that I will update Traefik.