Check Remote Server Cert with Openssl

Assume the server IP is 111.111.111.111, and we are interested in its port 443.

echo | openssl s_client -showcerts -connect 111.111.111.111:443 2>/dev/null | openssl x509 -inform pem -noout -text