aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-06-13 12:53:38 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-06-13 12:53:38 +0200
commit196fe1b0109ff42c9df52a5f8b2314aeff65cd5f (patch)
tree209eb71c124ff92e91ff6a7c264be8d41ca3fa13
parent1e29eeb388dff8f9cbb7e47e53146d4da87d3c81 (diff)
global-functions: $CertificateDownload: add proper version in user agent
-rw-r--r--global-functions.rsc7
1 files changed, 4 insertions, 3 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index d15567d..030892b 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -116,14 +116,15 @@
:global UrlEncode;
:global WaitForFile;
+ :local UserAgent ("User-Agent: Mikrotik/" . [ /system/resource/get version ] . " Fetch");
+
$LogPrintExit2 info $0 ("Downloading and importing certificate with " . \
"CommonName \"" . $CommonName . "\".") false;
:do {
:local LocalFileName ($CommonName . ".pem");
:local UrlFileName ([ $UrlEncode $CommonName ] . ".pem");
- /tool/fetch check-certificate=yes-without-crl \
- ($ScriptUpdatesBaseUrl . "certs/" . \
- $UrlFileName . $ScriptUpdatesUrlSuffix) \
+ /tool/fetch check-certificate=yes-without-crl http-header-field=$UserAgent \
+ ($ScriptUpdatesBaseUrl . "certs/" . $UrlFileName . $ScriptUpdatesUrlSuffix) \
dst-path=$LocalFileName as-value;
$WaitForFile $LocalFileName;
/certificate/import file-name=$LocalFileName passphrase="" as-value;