When I execute:
openssl s_client -connect google.com:443
openssl s_client -connect government.ru:443
This gives me valuable output, but I would like openssl
to close the connection and exit returning an integer exit code (different in) so that I could do something like this
echo "Domain?";read d
openssl s_client -connect "$d":443
if [[ "$?" -eq 0 ]]; then
echo "Encrypted"; do_something
else
echo "Plain."; do_something_else
fi