lego: TransIP verification fails because of token error

Welcome

  • Yes, I’m using a binary release within 2 latest releases.
  • Yes, I’ve searched similar issues on GitHub and didn’t find any.
  • Yes, I’ve included all information below (version, config, etc).

What did you expect to see?

Valid certificate issuance

What did you see instead?

time="2024-02-22T14:27:15Z" level=error msg="Unable to obtain ACME certificate for domains \"vps01.*****.net\"" providerName=letsencrypt.acme routerName=api@docker rule="Host(`vps01.*****.net`) && PathPrefix(`/api`)" ACME CA="https://acme-v02.api.letsencrypt.org/directory" error="unable to generate a certificate for the domains [vps01.*****.net]: error: one or more domains had a problem:\n[vps01.*****.net] [vps01.*****.net] acme: error presenting token: transip: could not get token from authenticator: could not decode private key\n"

How do you use lego?

Through Traefik

Reproduction steps

Docker Compose config:

      - --certificatesresolvers.letsencrypt.acme.dnsChallenge.provider=transip
      - --certificatesresolvers.letsencrypt.acme.dnsChallenge.resolvers="ns0.transip.net,ns1.transip.nl,ns2.transip.eu"
      - --certificatesresolvers.letsencrypt.acme.dnsChallenge.delayBeforeCheck=60
      - --certificatesresolvers.letsencrypt.acme.email=*****@*****
      - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
      - --log.level=DEBUG

Version of lego

According to Traefik V2.11.0 release:

github.com/go-acme/lego/v4 v4.15.0 h1:A7MHEU3b+TDFqhC/HmzMJnzPbyeaYvMZQBbqgvbThhU=
github.com/go-acme/lego/v4 v4.15.0/go.mod h1:eeGhjW4zWT7Ccqa3sY7ayEqFLCAICx+mXgkMHKIkLxg=

Logs

time="2024-02-22T14:27:13Z" level=debug msg="Building ACME client..." providerName=letsencrypt.acme
time="2024-02-22T14:27:13Z" level=debug msg="https://acme-v02.api.letsencrypt.org/directory" providerName=letsencrypt.acme
time="2024-02-22T14:27:14Z" level=info msg=Register... providerName=letsencrypt.acme
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] acme: Registering account for *****@*****"
time="2024-02-22T14:27:14Z" level=debug msg="Using DNS Challenge provider: transip" providerName=letsencrypt.acme
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] [vps01.*****.net] acme: Obtaining bundled SAN certificate"
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] [vps01.*****.net] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/*****"
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] [vps01.*****.net] acme: Could not find solver for: tls-alpn-01"
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] [vps01.*****.net] acme: Could not find solver for: http-01"
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] [vps01.*****.net] acme: use dns-01 solver"
time="2024-02-22T14:27:14Z" level=debug msg="legolog: [INFO] [vps01.*****.net] acme: Preparing to solve DNS-01"
time="2024-02-22T14:27:15Z" level=debug msg="legolog: [INFO] [vps01.*****.net] acme: Cleaning DNS-01 challenge"
time="2024-02-22T14:27:15Z" level=debug msg="legolog: [WARN] [vps01.*****.net] acme: cleaning up failed: transip: error for _acme-challenge.vps01.*****.net. in CleanUp: could not get token from authenticator: could not decode private key "
time="2024-02-22T14:27:15Z" level=debug msg="legolog: [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/*****"
time="2024-02-22T14:27:15Z" level=error msg="Unable to obtain ACME certificate for domains \"vps01.*****.net\"" providerName=letsencrypt.acme routerName=api@docker rule="Host(`vps01.*****.net`) && PathPrefix(`/api`)" ACME CA="https://acme-v02.api.letsencrypt.org/directory" error="unable to generate a certificate for the domains [vps01.*****.net]: error: one or more domains had a problem:\n[vps01.*****.net] [vps01.*****.net] acme: error presenting token: transip: could not get token from authenticator: could not decode private key\n"

Go environment (if applicable)

$ go version && go env
# paste output here

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Encoding problems, the hidden problems that can spend you hours on them 😸

FYI, I deleted all the information you provided from my computer and my mailbox.


Sponsoring is a good way to sustain open source maintainers: sponsor me

Hi all,

This is the solution, it is crazy and far fetched but with the awesome help if @ldez it was found and fixed!

On a non-functional server:

root@vps01:/opt/deployment/webserver# file -i traefik/transip.apikey 
traefik/transip.apikey: text/plain; charset=utf-8

On a functional server:

root@lb-01:/opt/traefik$ file -i transip.apikey 
transip.apikey: text/plain; charset=us-ascii

The encoding was off, and me beeing a total dumb*ss i copied the file contents to Idez, instead of the exact file which i could not retrieve natively.

Apparently the error “acme: error presenting token: transip: could not get token from authenticator: could not decode private key” also shows when the file encoding is not correct.

Since the file was created by an automation system, i will try to find why this happened in the first place, but for future people who experience this issue, Either try to convert your file to ascii with the command:

 iconv -f UTF-8 -t ASCII transip.apikey -o transip.apikey

or just write a new file with the same contents.

Once again Thanks @ldez for helping out, i would never found this myself!

That makes sense, because i put in a placeholder account. I fixed the issue, i’ll post separatly what it was so it can be pinned/marked as solution.