use x509 to check if server certificate has expired