dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit 67c4a3c82a5e94d1d87187fc26367463139fd3d3
parent b04132f988cf439b299bc5e5b25c7ea8d0acc7cf
Author: Paco Esteban <paco@onna.be>
Date:   Tue, 26 Jun 2018 14:39:08 +0200

simple script to check remote certs

Diffstat:
bin/bin/check_cert.sh | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/bin/bin/check_cert.sh b/bin/bin/check_cert.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +SERVER=$1 + +if [[ -z "$SERVER" ]]; then + echo "Usage $0: <server:port> [sni]" + exit 1 +fi + +if [[ "$2" == "sni" ]]; then + SERVER_WO_PORT=${SERVER/:*/} + WITH_SNI="-servername $SERVER_WO_PORT" +fi + +echo |\ + openssl s_client \ + $WITH_SNI \ + -connect "$SERVER" 2>/dev/null |\ + openssl x509 -text