Skip to content

nazmulkazi/SSLManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSL Downloader and Manager with Server API

I have a hosting server that comes with free SSL certificates for my domains. I have several local servers including a NAS to store all my inportant data, a JupyerLab server with GPUs for my language modeling research projects and a cluster-computer for parallel computing. Even though I have my own private subnet, I want to secure the communication between these devices. I also don't want Chrome to label the web interface of these servers as unsecure and block my access. So, I have created a sub-domain for each of my server, set up a local DNS to map them to their IP addresses, and installed the SSL certificate provided/generated by my hosting account to secure the communication. However, these certificates expire between 3 to 12 months and do not have a fixed length. So, I wrote these scripts to automate the process.

The api.php provides a simple and minimalistic example of the script that I put in my hosting server to receive requests from the ssl_downloader.py script. It fetchs the SSL certificates from cPanel API and forwards them to the Python script. Initially, I was making the request directly to the cPanel API but Cloudflare started blocking my API calls. Since, api.php runs locally in the hosting server when making the cPanel API calls, they do not go through Cloudflare.

The ssl_downloader.py script fetches the certificates from api.php and then stores the certificates and their metadata on the local device. You can use the config.json file to instruct the script to export the certificates to a path where the local device looks for the certificates. Alternatively, you can also instruct ssl_downloader.py to execute a command when a new certificate is downloaded.

I also use SSL certificates to secure Remote Desktop Connection between Windows devices. The rds_ssl_manager.py script takes the SSL certificates and installs them to be used for any Remote Desktop Connection to that device.

Examples

A cronjob in my TrueNAS Scale server:

cd /mnt/Alpha/home/root/ssl/ && python ssl_downloader.py --on-export "python ui_ssl_manager.py" >> cron.log 2>&1

About

A set of Python scripts and a PHP API to automate SSL certificate management for local servers and devices, ensuring up-to-date certificates for secure communication on a local network.

Topics

Resources

License

Stars

Watchers

Forks

Contributors