une fonction pour vérifier un certificat remote sur un local ca.crt
verify_cert ()
{
g=${PWD};
cd /tmp;
echo $2 | cut -c 1 | grep --color=auto -iEq '\.|\/';
if [ $? -eq 0 ]; then
capath=$2;
else
capath=$g/$2;
fi;
echo verifying $1 against $capath...;
openssl s_client -showcerts -connect $1 < /dev/null 2> /dev/null | openssl x509 -outform PEM > cert.pem && openssl verify -verbose -CAfile $capath cert.pem;
ret=$?;
cd -;
return $ret
}