Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15394

General • Re: Renewing Let's Encrypt SSL Certificate

$
0
0
Hi Everyone,

This is something that was working really well... but seems not to work anymore. My script (below) renews the let's encrypt certificate that is used for my SSTP VPN.
To recap, it's an RB4011 running ROS 7.12.1
What I don't understand is that I've run every line of the script (replacing the variable names with the variable values of course) in the Terminal window and it does everything that I would expect it to do and renews the certificate.
Could this be permissions somewhere?
Code:
:log info "Script - Certificate renewal start":local commName "[##DNS-CLOUD-NAME##]"#Enable the WWW service and open Port 80 on the Input chain/ip service enable [find name=“www”]/ip firewall filter enable [find where comment="LetsEncrypt"]#Delete old certificate, create new certificate/certificate remove [find where common-name=$commName]/certificate enable-ssl-certificate dns=$commName:delay 60s/certificate :local certName [get [find where common-name=$commName] name]#Set new certificate in SSTP Profile/interface sstp-server server set certificate=$certName#Disable the WWW service and close Port 80 on the Input chain/ip service disable [find name=“www”]/ip firewall filter disable [find where comment="LetsEncrypt"]
The script is implemented in router as follows:
Code:
/system script add dont-require-permissions=no name=LetsEncryptRenewal owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
(I've omitted the source= part of the above bit of the config, as I've given the script above).

Statistics: Posted by ColinSlater — Sat Feb 03, 2024 8:21 am



Viewing all articles
Browse latest Browse all 15394

Trending Articles