title: OpenSSL crypto error: [('PEM routines', 'PEM_read_bio', 'no start line')]
body: <p>I am getting the following error when trying to read a certificate:</p>
  
  <pre><code>OpenSSL.crypto.Error: [('PEM routines', 'PEM_read_bio', 'no start line')]
  </code></pre>
  
  <p>when running <code>OpenSSL.crypto.load_certificate(FILETYPE_PEM, filename)</code>. I have made some research but was not able to find an answer specific to my case.</p>
  
  <p>I tried checking if the file existed with <code>os.path.isfile(filename)</code> which returns <code>True</code>, but loading the certificate ONLY raises the error above.</p>
  
  <p>Also, when executing on the terminal <code>openssl X509 -in file.pem</code>, it works like a charm.</p>
  
  <p>The file.pem looks like this:</p>
  
  <pre><code>-----BEGIN CERTIFICATE-----
  &lt;&lt;sensitive data&gt;&gt;
  -----END CERTIFICATE-----
  </code></pre>
  
  <p>It seems to be valid since I able to perform basic <code>openssl</code> operations on the terminal. I am running CentOS 7, if that helps.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>