I’m trying to automate cert requests for new website customers of ours who have not yet pointed their DNS to us. Our software requires HTTPS to be turned on the moment a new website is created, so http challenge is not an option for the original cert request since new customers are not pointed to us. DNS challenge is what we’re hoping to use, but the TXT DNS record generated does not appear to persist when I run the script again later or just try to complete the verification later. We will need to generate the DNS TXT verification entry, send it to our new customer, and then wait for them to get it created. This can sometimes take days.
Ideal Process:
- We run a script that takes a domain as input & requests a new cert from LE
- We get back a TXT entry that we send to the customer
- Once that entry is created, we complete the DNS verification step & get our cert
Is this possible with Crypt-LE? @leader
How long are those DNS TXT entries valid?
My domain is: test.madbray.com
Client: Crypt::LE (le64.exe on Windows) https://github.com/do-know/Crypt-LE
I ran this command:
le64.exe --key test.madbray.com\acco
unt.key --csr test.madbray.com\test_madbray_com_csr.csr --csr-key test.madbray.c
om\test_madbray_com_priv.crt --crt test.madbray.com\test_madbray_com.crt --domai
ns test.madbray.com --handle-as dns --generate-missing --live
It produced this output:
2018/10/30 15:00:27 [ ZeroSSL Crypt::LE client v0.31 started. ]
2018/10/30 15:00:27 Loading an account key from test.madbray.com\account.key
2018/10/30 15:00:27 Loading a CSR from test.madbray.com\test_madbray_com_csr.csr
2018/10/30 15:00:28 Registering the account key
2018/10/30 15:00:28 The key is already registered. ID: 34310605
2018/10/30 15:00:28 Current contact details: redactd@madbray.com
Challenge for 'test.madbray.com' requires the following DNS record to be created
:
Host: _acme-challenge.test.madbray.com, type: TXT, value: ibrwvLeJsCM8pPwXyEwJRB
_5UXsDg_wAUa7Z9mBt9IY
Wait for DNS to update by checking it with the command: nslookup -q=TXT _acme-ch
allenge.test.madbray.com
When you see a text record returned, press <Enter>
Here is where I simulated a customer taking a day to get the DNS entry in place (I actually left the script open for a day just to test). I put the requested TXT entry in place on my active DNS servers, then hit Enter:
2018/10/31 10:30:50 Processing the 'dns' verification for 'test.madbray.com'
2018/10/31 10:30:50 Domain verification results for 'test.madbray.com': error. J
WS has invalid anti-replay nonce POVfkWIRpRIJDBUsy0SOILcWrUSIz6CYGNxXokGHbEU
2018/10/31 10:30:50 You can now delete '_acme-challenge.test.madbray.com' DNS re
cord
2018/10/31 10:30:50 All verifications failed
My web server is (include version): IIS 6 & 7
The operating system my web server runs on is (include version): Windows Server 2008 R2 (and Serve 2003 R2)
My hosting provider, if applicable, is: n/a - we are a hosting company
I can login to a root shell on my machine (yes or no, or I don’t know): Yes
I’m using a control panel to manage my site (no, or provide the name and version of the control panel): No