title: _ssl.c:351: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
body: <p>I want to connect to a web server that has a self-signed certificate, with Requests:</p>
  
  <pre><code>try:
      requests.get(url, cert=PATH_CERTIFICATE)
  except requests.exceptions.ConnectionError as e:
      logger.info(e)
  </code></pre>
  
  <p>But it fails with the following:</p>
  
  <blockquote>
    <p>[Errno 336265225] _ssl.c:351: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib</p>
  </blockquote>
  
  <p>I got this certificate by running this command:</p>
  
  <pre><code>openssl s_client -showcerts -ssl3 -connect &lt;hostname:port&gt;
  </code></pre>