oneliners/bash/split-ssl-certs.sh

5 lines
313 B
Bash
Raw Normal View History

2023-04-19 13:25:39 +02:00
#!/bin/bash
# split cert-chain received from server in seperate certificates
openssl s_client -showcerts -servername someserverssniname.intra.dlr.de -connect someserver.intra.dlr.de:443 < /dev/null | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/ p' | csplit -f cert - '/-----BEGIN CERTIFICATE-----/' '{*}'