• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Lets encrypt refresh certificate by script?

Bossman

Basic Pleskian
Hello,

Since i do not use plesk DNS server, i wanted to do external DNS update for TXT record _acme-challenge, since every 3 months i need to update every domain at my dns provider. So script is done, but at end i would want to know how to reload certificate (blue screeen with button reload) via
1. commandline ? i have tried plesk bin extension lets encrypt - it does not work.
2. or php/lib/RestAPI - that does not have such option i think.
3. or maybe by setting some flag in psa database ? - yea that will be best for me, but risky.

ps. I see that plesk is checking certificates and after night i have got reloaded certificates, so is it done by cron maybe ?.
 
Okay let me check, thanks.
Do you know where letsencrypt certificate store its end date / database ? / files ?, so my script could know when to "do" above extension query ?
 
One doesn't really need to know this. Simply create a cron job that runs the command once a month. If a certificate is not due for renewal, it won't renew. If it is due for renewal, it will renew.
 
Not sure if expire date is stored some were. However, letsencrypt certificates are valid for 90 days. So you just could renew them within 90 days.
 
Not sure if expire date is stored some were. However, letsencrypt certificates are valid for 90 days. So you just could renew them within 90 days.
It is in the certificate itself. But you could also take an educated guess from the file's timestamp.

The extension, just like LetsEncrypt's own script, will renew a certificate if there are only 30 days left. Unless you force it to renew earlier.
 
The extension, just like LetsEncrypt's own script, will renew a certificate if there are only 30 days left. Unless you force it to renew earlier.
I think it can only do this for wildcard certificates if the DNS record is located on the Plesk system. However, @Bossman wrote that he is using an external DNS. For that reason he needs to update his acme entry in his DNS system manually before the renewal takes place. It won't renew automatically, because the acme entry needs to have the correct value first. That's why he needs to renew "manually" or at least by a script when he does not automatically set the correct new DNS entry before an automatic renewal attempt is made.
(This was my last state of knowledge, please correct me if I am wrong with the wildcard entries. It might have changed, I have not been using this for a while.)
 
For that reason he needs to update his acme entry in his DNS system manually before the renewal takes place. It won't renew automatically, because the acme entry needs to have the correct value first.
But it has to run once so he knows what to change the _acme entry to :)
 
The update cert is not working, i have execute it in commandline and in Plesk Cert did not update itself (Acme is propagated correcly).

Zrzut ekranu 2021-09-26 o 19.42.46.png
As you see in screen i have executed update command for same cert, then i click refresh page at plesk cert gui, and sadly button (przeładuj - refresh) is still there. :(
 
Back
Top