oneliners/bash/check_cert_of_remote_host.sh

4 lines
251 B
Bash
Raw Normal View History

2023-01-05 13:48:29 +01:00
#!/bin/bash
# check cert (and not only a successfully connect) of a remote server with openssl:
CHECK_HOST="google.com:443"; echo -n | openssl s_client -connect $CHECK_HOST | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -text