Check a TLS certificate chain from the command line

openssl s_client -connect shop.example.com:443 -servername shop.example.com 
  < /dev/null 2>&1 | grep -E 'depth=|Verify return code'