aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-04-10 14:47:20 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-04-10 14:47:20 +0200
commit58c25c8ccaaa9e559f3544b36cfb99af6dcc225e (patch)
treed70d2fc3a22fd4e64402f7dfafd47212186492a8
parente562825bd9580dabdbccb1d1228ea62034e2f65d (diff)
check-certificates: add url encoding for certificate download
-rw-r--r--check-certificates10
1 files changed, 6 insertions, 4 deletions
diff --git a/check-certificates b/check-certificates
index b163ba6..16bcd32 100644
--- a/check-certificates
+++ b/check-certificates
@@ -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);
}
}