go-acme / lego

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

Add DNS provider for Mail-in-a-Box #2110

Closed ldez closed 4 months ago

ldez commented 4 months ago

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

Closes #1459

ldez commented 4 months ago

@kbudde I saw your project after I created this PR, maybe this PR can interest you. If you have some time to test it, that would be great :heart:.

ldez commented 4 months ago

@kbudde do you have some time to test the PR? Or maybe you know a Mail-in-a-Box user who can test it?

I create a PR only based on API doc, I need a user to test it because I know that documentation is not always accurate.

kbudde commented 4 months ago

I see, I will test it at the weekend 😀

kbudde commented 4 months ago

@ldez had suddenly some free minutes and tested some combinations. Works like a charm.

2024/02/23 20:09:05 [INFO] [*.bar.budd.ee, foo.budd.ee] acme: Obtaining bundled SAN certificate
2024/02/23 20:09:06 [INFO] [*.bar.budd.ee] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/11329328053
2024/02/23 20:09:06 [INFO] [foo.budd.ee] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/11329328063
2024/02/23 20:09:06 [INFO] [*.bar.budd.ee] acme: use dns-01 solver
2024/02/23 20:09:06 [INFO] [foo.budd.ee] acme: Could not find solver for: tls-alpn-01
2024/02/23 20:09:06 [INFO] [foo.budd.ee] acme: Could not find solver for: http-01
2024/02/23 20:09:06 [INFO] [foo.budd.ee] acme: use dns-01 solver
2024/02/23 20:09:06 [INFO] [*.bar.budd.ee] acme: Preparing to solve DNS-01
2024/02/23 20:09:08 [INFO] [foo.budd.ee] acme: Preparing to solve DNS-01
2024/02/23 20:09:11 [INFO] [*.bar.budd.ee] acme: Trying to solve DNS-01
2024/02/23 20:09:11 [INFO] [*.bar.budd.ee] acme: Checking DNS record propagation. [nameservers=127.0.0.53:53]
2024/02/23 20:09:15 [INFO] Wait for propagation [timeout: 2m0s, interval: 4s]
2024/02/23 20:09:21 [INFO] [*.bar.budd.ee] The server validated our request
2024/02/23 20:09:21 [INFO] [foo.budd.ee] acme: Trying to solve DNS-01
2024/02/23 20:09:21 [INFO] [foo.budd.ee] acme: Checking DNS record propagation. [nameservers=127.0.0.53:53]
2024/02/23 20:09:25 [INFO] Wait for propagation [timeout: 2m0s, interval: 4s]
2024/02/23 20:09:28 [INFO] [foo.budd.ee] The server validated our request
2024/02/23 20:09:28 [INFO] [*.bar.budd.ee] acme: Cleaning DNS-01 challenge
2024/02/23 20:09:31 [INFO] [foo.budd.ee] acme: Cleaning DNS-01 challenge
2024/02/23 20:09:33 [INFO] [*.bar.budd.ee, foo.budd.ee] acme: Validations succeeded; requesting certificates
2024/02/23 20:09:33 [INFO] Wait for certificate [timeout: 30s, interval: 500ms]
2024/02/23 20:09:35 [INFO] [*.bar.budd.ee] Server responded with a certificate.```

It's even possible to use a apikey instead of a password. https://mailinabox.email/api-docs.html#tag/User

ldez commented 4 months ago

thank you :heart: