From 196fe1b0109ff42c9df52a5f8b2314aeff65cd5f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jun 2023 12:53:38 +0200 Subject: global-functions: $CertificateDownload: add proper version in user agent --- global-functions.rsc | 7 ++++--- 1 file 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; -- cgit v1.2.3-54-g00ecf