keyAuthorization in dns-01 challenge


#1

should the value of _acme-challenge.mydomain.com TXT dns record be exactly same as what client sent in challenge resource?


#2

In short, no.

You need to sign with the account key ( see https://letsencrypt.github.io/acme-spec/#rfc.section.7.4 )

The client serializes the validation object to UTF-8, then uses its account private key to sign a JWS with the serialized JSON object as its payload. This JWS is NOT REQUIRED to have the “nonce” header parameter.

The record provisioned to the DNS is the “signature” value from the JWS, i.e., the base64-encoded signature value.

#3

here http://ietf-wg-acme.github.io/acme/#rfc.section.7.4
it says sha265 digest is it hexadecimal form?


#4

What language are you writing this in ? mine is a bash script, if looking at that helps ( https://github.com/srvrco/getssl )


#5

i am trying with php


#6

The coding for the DNS challenge token is essentially the same as the HTTP challenge, I think all the other php clients only do the HTTP challenge, but you could check the code for that ( or use your HTTP challenge if you have already written that ).


#7

in your bash script $auth_key is this the variable that is holding TXT dns record _acme-challenge.mydomain.com value ?


#8

Correct, yes.

( $auth_key is the variable that is holding TXT dns record … needed to add text to lengthen the reply :wink: )


#9

i have successfully completed HTTP challenge but dns challenge needs additional sha256 but don’t know exactly.


#10

wow finally got it working.
a stupid mistake in the coding that caused all this headache.


#11

What was the mistake? I am trying to get my dns-01 challenge working with PHP.
Trying for the last two days without any luck.

As you mentioned, my http challenge is working fine.


#12

Hi, can you provide the script for me ? thank you.


#13

Hey Hotwop, I’d also like to see a PHP program that can run the dns-01 challenge method.