openssl s_client -connect localhost:6443 -showcerts < /dev/null 2>&1 | openssl x509 -noout -enddate
Beispiel:
root@kubepi03:~# openssl s_client -connect localhost:6443 -showcerts < /dev/null 2>&1 | openssl x509 -noout -enddate
notAfter=Oct 9 17:06:31 2022 GMT
\\
for crt in /var/lib/rancher/k3s/server/tls/*.crt;
do printf '%s: %s\n' "$(date --date="$(openssl x509 -enddate -noout -in "$crt"|cut -d= -f 2)" --iso-8601)" "$crt";
done | sort