← ../

test ssl connectivity with openssl s_client

test connectivity:

export SERVERNAME=example.com
export PORT=443
openssl s_client -showcerts -servername "$SERVERNAME" -connect "$SERVERNAME":"$PORT" 2>/dev/null

you can also pipe the result to openssl to inspect various fields of the cert:

export SERVERNAME=example.com
export PORT=443
openssl s_client -showcerts -servername "$SERVERNAME" -connect "$SERVERNAME":"$PORT" | openssl x509 -noout -issuer -subject -dates