Read certificate chain with openssl
openssl s_client -showcerts -servername www.google.com -connect www.google.com:443 </dev/null