Skip to content

Automatically update SSL certificates for your website using cpanel API and acme.sh

License

Notifications You must be signed in to change notification settings

gekigek99/cpanel-cert-renewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cpanel-cert-renewer

This script is used to auto update the ssl certificates for your website by interacting with cpanel API and acme.sh

It is able to generate and install wildcard certificates for a domain and its subdomains

set up procedure:

  1. download acme.sh with curl https://get.acme.sh | sh
  2. add "acmepath" and "acmefold" parameters to the config
  3. add your cpanel address to "cpanel" parameter
  4. add your cpanel username to "user" parameter
  5. in cpanel generate a token and add it to "token" parameter
  6. in cpanel in DNS zone editor add 2 TXT records called "_acme-challenge."
  7. after adding your info execute this curl request: curl --request GET --url 'https://<cpanel address>:2083/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&domain=<domain>' --header 'Authorization: cpanel <user>:<token>'
  8. look for the 2 records beginning with "_acme-challenge" and save their lines in the config in "dnsZoneLine" as a list
  9. add the domain and relative subdomains

you can now execute the python program!

(i advise you to run this program once a week with a cron job)

Disclaimer:

I am not responsible for damages that this software might cause to your system or website.
Be sure to understand the basics of how acme.sh and ssl certificates work before using this software.
Read carefully the code to understand how it works and avoid problems.
There might be important bugs related to the complicated matter this program has to manage.

About

Automatically update SSL certificates for your website using cpanel API and acme.sh

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages