Get ssl certificate expired date by cmd

Get ssl certificate expired date by cmd

$ echo "QUIT" | openssl s_client -connect cdf-retrieval-ocs-205065-main-public-production.tr-fr-prod.aws-int.thomsonreuters.com:443 2>/dev/null | openssl x509 -noout -enddate 2>/dev/null
notAfter=Jan 25 23:59:59 2022 GMT

# echo "QUIT" | openssl d-connect google.com:443 2>/dev/null | openssl x509 -noout -startdate 2>/dev/null