check-certificates: support multiple passphrases

This commit is contained in:
Christian Hesse 2019-04-01 22:45:38 +02:00
parent 40201ac1ea
commit 594aef2aab
4 changed files with 10 additions and 4 deletions

View file

@ -34,7 +34,9 @@
} }
/ tool fetch mode=https check-certificate=yes-without-crl url=($CertRenewUrl . $CommonName . ".pem"); / tool fetch mode=https check-certificate=yes-without-crl url=($CertRenewUrl . $CommonName . ".pem");
/ certificate import file-name=($CommonName . ".pem") passphrase=$CertRenewPass; :foreach PassPhrase in=$CertRenewPass do={
/ certificate import file-name=($CommonName . ".pem") passphrase=$PassPhrase;
}
/ file remove [ find where name=($CommonName . ".pem") ]; / file remove [ find where name=($CommonName . ".pem") ];
:local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ]; :local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ];

View file

@ -6,7 +6,7 @@
# Make sure all configuration properties are up to date and this # Make sure all configuration properties are up to date and this
# value is in sync with value in script 'global-functions'! # value is in sync with value in script 'global-functions'!
:global GlobalConfigVersion 2; :global GlobalConfigVersion 3;
# This is used for DNS and backup file. # This is used for DNS and backup file.
:global Domain "example.com"; :global Domain "example.com";
@ -97,4 +97,7 @@
# Use this for certificate auto-renew # Use this for certificate auto-renew
:global CertRenewUrl ""; :global CertRenewUrl "";
#:global CertRenewUrl "https://example.com/certificates/"; #:global CertRenewUrl "https://example.com/certificates/";
:global CertRenewPass "v3ry-s3cr3t"; :global CertRenewPass {
"v3ry-s3cr3t";
"4n0th3r-s3cr3t";
}

View file

@ -5,4 +5,5 @@
:global GlobalConfigChanges { :global GlobalConfigChanges {
1="moved variables from global-config to global-functions for independence"; 1="moved variables from global-config to global-functions for independence";
2="variable names became CamelCase to work around scripting issues"; 2="variable names became CamelCase to work around scripting issues";
3="variable for certificate renew passphrase became an array to support multiple passphrases";
}; };

View file

@ -5,7 +5,7 @@
# global functions # global functions
# expected configuration version # expected configuration version
:global ExpectedConfigVersion 2; :global ExpectedConfigVersion 3;
# global variables not to be changed by user # global variables not to be changed by user
:global SentRouterosUpdateNotification "-"; :global SentRouterosUpdateNotification "-";