Checking whether an HTTPS certificate is valid, trusted, and not expired
Using openssl to inspect a certificate's chain, expiry date, and hostname match by hand.