mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-28 20:30:05 +02:00
check-certificates: add url encoding for certificate download
This commit is contained in:
parent
e562825bd9
commit
58c25c8cca
1 changed files with 6 additions and 4 deletions
|
@ -9,6 +9,7 @@
|
|||
:global CertRenewPass;
|
||||
|
||||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
|
||||
:local GetIssuerCN do={
|
||||
:foreach IssuerI in=$1 do={
|
||||
|
@ -35,14 +36,15 @@
|
|||
}
|
||||
|
||||
:foreach Type in={ ".pem"; ".p12" } do={
|
||||
:local CertFileName ([ $UrlEncode $CommonName ] . $Type);
|
||||
:do {
|
||||
/ tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CommonName . $Type);
|
||||
/ tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CertFileName);
|
||||
:foreach PassPhrase in=$CertRenewPass do={
|
||||
/ certificate import file-name=($CommonName . $Type) passphrase=$PassPhrase;
|
||||
/ certificate import file-name=$CertFileName passphrase=$PassPhrase;
|
||||
}
|
||||
/ file remove [ find where name=($CommonName . $Type) ];
|
||||
/ file remove [ find where name=$CertFileName ];
|
||||
} on-error={
|
||||
:log debug ("Could not download certificate file " . $CommonName . $Type);
|
||||
:log debug ("Could not download certificate file " . $CertFileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue