A while ago I wrote an article that described all the steps necessary to obtain a free SSL certificate with a validity of 90 days. Check it out: https://www.ajni.it/2019/06/claiming-a-free-ssl-certificate-for-your-website/
While it’s good to know how things work, the task gets boring and repetitive if you have to do it every 3 months and in my case for two different domains. This is why I wrote a small and straightforward script in Python3 that does that all for me.
ZeroSSL offers an API that allows us to automate this task by making some HTTP calls with an API key obtainable after registering.
I have uploaded the script on GitHub, check it out:
https://github.com/ajnik/ZeroSSL-CertRenew
There are some variables that must be changed:
- Line 19: API key
- Line 20: Domain name
- Line 43 to 52: Request paramteres (O, OU, L, ST, C)
Execute the script with
python3 ZeroSSL_CertRenew.py
The script does no exception handling. I might improve it in the future.
Let me know if you have any suggestions. I am pretty new to Python programming so every tip is welcome.