pfsense acme certificate and upload via sftp to wing-ftp server. We want to let pfsense/acme create a "let's encrypt" and then transfer it to the wing-ftp server and reload the certificate on the wing-ftp server. Let's go! Requirements: - A DNS-Provider with API - FTP-Username on the wing-ftp host: pfsense 1. pfsense: Create a key for password free login from the pfsense(root) user to the wingftp-user(username=pfsense) a. on the pfsense cli type the command (no passphrase) [ssh-keygen -t rsa] b. view the new key [cat /root/.ssh/id_rsa.pub] 2. pfsense: Create a account key and certificate, search "pfsense acme api" on youtube or websites.. 3. wingftp-host: Copy the cli output to the wing-ftp server in a file (c:\sshkeys\root@pfsense.txt) 4. wingftp-host: Create the ftp-user in the wingftp admincenter > domain/user 5. wingftp-host: Change the ftp-user In the wingftp admincenter > domain/user/limit/ssh key authentication this file path, and set use authentication over public key 6. pfsense: Services/Certificates/Edit/Action list at the command: echo 'mput /conf/acme/ftp.* /' | sftp pfsense@ftp 7. wingftp-host: add the lua script Put this Script in Admin-Webinterface /SSH Events/OnFileUploaded Change your variables! local username = "%Name" if username == "pfsense" then local strFileName = "%FileName" local strDomain = "mydomain.net" local strSubject = "FTP Zertifikat wurde hochgeladen" local strText = "WingFTP Zertifikat für Domain " .. strDomain .. " wird neu geladen!" if string.find(strFileName,"ftp.mydomain.net.crt") then c_SendMail("administrator@mydomain.net", strSubject, strText, "", "myDomain") c_SetOptionInt(strDomain, DOPTION_TLS_SESSION_TIMEOUT, 3600+(c_GetRandom()%100)) end end