title: read certificate(.crt) and key(.key) file in python
body: <p>So i'm using the JIRA-Python module to connect to my company's instance on JIRA and it requires me to pass the certificate and key for this.
  However using the OpenSSL module,i'm unable to read my local certificate and key to pass it along the request.</p>
  
  <p>the code for reading is below</p>
  
  <pre><code>import OpenSSL.crypto 
  c = open('/Users/mpadakan/.certs/mpadakan-blr-mpsot-20160704.crt').read()
  cert = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, c)
  </code></pre>
  
  <p>the error i get is </p>
  
  <pre><code>Traceback (most recent call last):
  File "flaskApp.py", line 19, in &lt;module&gt;
  cert = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, c)
  TypeError: must be X509, not str
  </code></pre>
  
  <p>could someone tell me how to read my local .crt and .key file into x509 objects?</p>