Page 1 of 1

Use to generate/renew Let's Encrypt SSL cert

Posted: Fri Dec 22, 2023 3:36 pm
by FTP is a simple and easy-to-use ACME protocol (Automatic Certificate Management Environment) client, you can use it to generate and renew Let's Encrypt/ZeroSSL's certificates.

First you may install via a simple command:

Code: Select all

curl -k | sh
Then generate signed SSL certs by executing the following commands:

Code: Select all

cd ~/
./ --set-default-ca --server letsencrypt
./ --issue -d -w /opt/wftpserver/webclient
Here, "" is your real domain name, and "/opt/wftpserver/webclient" is WingFTP's web client folder, you may change it into your own path (where WingFTP installed).

All the signed certs will be placed in "~/".
In WingFTP's administration, you may add an SSL cert configuration under "Server > Settings > SSL Certificate Manager", choose "fullchain.cer" as the certificate, and choose "" as the private key:

You also need to select this new cert under "Domain > Settings > General Settings > Miscellaneous > SSL Certificate":

WingFTP will cache the SSL context, so you need to reload the SSL context after renewing the cert. You can add a daily task under "Server > Task Scheduler" and input the below lua script:

Code: Select all

for _,domain in pairs(c_GetDomainList()) do
	c_SetOptionInt(domain, DOPTION_TLS_SESSION_TIMEOUT, 3600+(c_GetRandom()%100))

For Windows Systems, you need a Cygwin environment. If you do not have Cygwin, maybe you can install Git and run all the above commands in Git Bash:
Linux system has a daily cron job to check and renew the certs if needed, but in Windows Git Bash, cron is not included by default, so you need to schedule a task to renew the SSL cert every 30 days, just execute the following command to schedule a task:

Code: Select all

schtasks /create /tn "Renew SSL cert" /tr "'C:/Program Files/Git/bin/sh.exe' --login -i -c 'C:/Users/xxx/ --renew -d --force --ecc'" /sc daily /mo 30 /it
Please change "xxx" into your own username, make sure "sh.exe" and "" already installed.