1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -eu
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT HUP INT TERM
probe() {
timeout 5 openssl s_client -connect "$1:443" -servername "$1" \
-verify_hostname "$1" -verify_return_error -brief </dev/null
}
probe atproto.com >"$work/control" 2>&1 || {
cat "$work/control" >&2
echo 'Valid TLS control failed' >&2
exit 1
}
for host in dv-g3b-emudhra.we-have-a-problem.com dv-g3b-aaa-emudhra.we-have-a-problem.com; do
if probe "$host" >"$work/rejected" 2>&1; then
echo "FAIL: $host is still trusted" >&2
exit 1
fi
if ! grep -Eq 'verify error:num=(20|21|23):' "$work/rejected"; then
cat "$work/rejected" >&2
echo "FAIL: $host did not fail with an untrusted/revoked certificate" >&2
exit 1
fi
echo "PASS: $host rejected by the runtime CA bundle"
done