title: How to determine SSL cert expiration date from a PEM which have a lot of certificats concatenated on one file (pem)?
body: <p>How to determine SSL cert expiration date from a PEM which have a lot of certificats concatenated on one file (pem) ?</p>
  
  <p>Example:</p>
  
  <pre><code># cat cert.pem
  
  -----BEGIN CERTIFICATE----- 
  
  ... 
  
  -----END CERTIFICATE----- 
  
  -----BEGIN CERTIFICATE----- 
  
  ... 
  
  -----END CERTIFICATE-----
  </code></pre>
  
  <p>The command below, give me only the end date of the first certificate on the file </p>
  
  <pre><code># openssl x509 -in cert.pem -noout -enddate
  notAfter=Sep 26 16:12:59 2019 GMT
  </code></pre>
  
  <p>Have you any idea to get end date of all certificates (one by one) using shell?</p>