title: How to check expiry date of remote ssl certificates
body: <p>I'm testing a one liner that I'll eventually put in a script to do this on a cron. I'd like to take a list of servers and connect to them and check the expiry date of their certificates. </p>
  
  <p>I'm currently using openssl and running a client connect then taking the output and using openssl to get the certificate's information. 
  This is what I have so far for the CLI test (which would execute per server) but I'm getting an error. What am I missing?</p>
  
  <pre><code># /usr/local/ssl/bin/openssl s_client -connect my_web_server_ip:443 2&gt;/dev/null | /usr/local/ssl/bin/openssl x509 -noout -dates
  unable to load certificate
  4274947916:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: TRUSTED CERTIFICATE
  </code></pre>