openssl x509 -enddate -noout -in file.crtecho | openssl s_client -connect SERVICENAME:443 2>/dev/null | openssl x509 -noout -enddate