mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
9 lines
274 B
Bash
9 lines
274 B
Bash
retrieve_ssl_certificate_chain() {
|
|
openssl s_client -connect $1 -showcerts </dev/null 2>/dev/null | awk \
|
|
' BEGIN { incert = 0 }
|
|
/-----BEGIN CERTIFICATE-----/ { incert = 1 }
|
|
incert == 1 { print $0 }
|
|
/-----END CERTIFICATE-----/ { incert = 0 }
|
|
'
|
|
}
|