Skip to content
Snippets Groups Projects
Commit 3fbb9d55 authored by Martin Strbacka's avatar Martin Strbacka
Browse files

Merge branch 'master' of gitlab.labs.nic.cz:turris/misc

parents 871a73ec b1f5b775
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
set -ex
# The time of 4 hours should be enough for the CRL not to time out. Hopefuly.
if [ -f /tmp/crl.pem ] && [ "$((`date +%s`-4*3600))" -lt "$((`date -r /tmp/crl.pem +%s`))" ] ; then
exit
fi
mkdir /tmp/crldown
trap 'rm -rf /tmp/crldown' EXIT ABRT QUIT TERM
cd /tmp/crldown
echo | openssl s_client -connect api.turris.cz:443 -showcerts | awk -v c=-1 '/-----BEGIN CERTIFICATE-----/{inc=1;c++} inc {print > (c ".pem")}'
for i in *.pem ; do
# This is a hack a bit, we expect the hostname to be crl\. something. Our CA satisfies this now and if it breaks, we would find out.
openssl x509 -in "$i" -noout -text | grep -o 'http://crl\..*' | xargs curl | openssl crl -inform der -out tmp.pem
cat tmp.pem >>out.pem
done
mv out.pem /tmp/crl.pem
......@@ -28,6 +28,9 @@
# Configuration
set -ex
# Download CRL for curl.
get-api-crl
# List of daemon names. Separate by \|, it's put into the regular expression.
DAEMONS='ucollect\|updater\|watchdog\|oneshot\|nikola\|nethist'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment