requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
<p><strong>This is not a duplicate of <a href="http://stackoverflow.com/questions/35403605/ssl-certificate-verify-failed-ssl-c600">this question</a></strong></p>

<p>I checked <a href="http://stackoverflow.com/questions/38522939/requests-exceptions-sslerror-ssl-certificate-verify-failed-certificate-verif">this</a> but going insecure way doesn't looks good to me.</p>

<p>I am working on image size fetcher in python, which would fetch size of image on a web page. Before doing that I need to get web page status-code. I tried doing this way </p>

<pre class="lang-py prettyprint-override"><code>import requests

hdrs = {'User-Agent': 'Mozilla / 5.0 (X11 Linux x86_64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 52.0.2743.116 Safari / 537.36'}


urlResponse = requests.get(
    'http://aucoe.info/', verify=True, headers=hdrs)
print(urlResponse.status_code)
</code></pre>

<p>This gives error:</p>

<blockquote>
  <p>ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
  failed (_ssl.c:600)</p>
</blockquote>

<p>I tried changing <code>verify=True</code> to</p>

<p><code>verify='/etc/ssl/certs/ca-certificates.crt'</code></p>

<p>and </p>

<p><code>verify='/etc/ssl/certs'</code></p>

<p>But it still gives the same error.
I need to get status code for more than 5000 urls. Kindly help me.
Thanks in advance.</p>

<p><strong>Python Version :</strong> 3.4</p>

<p><strong>Requests version :</strong> requests==2.11.1</p>

<p><strong>O.S :</strong> Ubuntu 14.04</p>

<p><strong>pyOpenSSL :</strong> 0.13</p>

<p><strong>openssl version :</strong> OpenSSL 1.0.1f 6 Jan 2014</p>

<p>You need to download the GoDaddy root certificates, available at <a href="https://certs.godaddy.com/repository" rel="nofollow">this site</a> and then pass it in as a parameter to <code>verify</code>, like this:</p>

<pre><code>&gt;&gt;&gt; r = requests.get('https://aucoe.info', verify='/path/to/gd_bundle-g2-g1.crt')
&gt;&gt;&gt; r.status_code
200
</code></pre>

<p>If you'll be doing multiple requests, you may want to configure the SSL as part of the session, as highlighted in the <a href="http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification" rel="nofollow">documentation</a>.</p>

python python-3.x ssl ssl-certificate python-requests