Note that there are some explanatory texts on larger screens.

plurals
  1. POIgnore certificate validation with urllib3
    primarykey
    data
    text
    <p>I'm using urllib3 against private services that have self signed certificates. Is there any way to have urllib3 ignore the certificate errors and make the request anyways?</p> <pre><code>import urllib3 c = urllib3.HTTPSConnectionPool('10.0.3.168', port=9001) c.request('GET', '/') </code></pre> <p>When using the following:</p> <pre><code>import urllib3 c = urllib3.HTTPSConnectionPool('10.0.3.168', port=9001, cert_reqs='CERT_NONE') c.request('GET', '/') </code></pre> <p>The following error is raised:</p> <pre><code>Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/usr/lib/python3/dist-packages/urllib3/request.py", line 67, in request **urlopen_kw) File "/usr/lib/python3/dist-packages/urllib3/request.py", line 80, in request_encode_url return self.urlopen(method, url, **urlopen_kw) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 415, in urlopen body=body, headers=headers) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 267, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.3/http/client.py", line 1061, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.3/http/client.py", line 1099, in _send_request self.endheaders(body) File "/usr/lib/python3.3/http/client.py", line 1057, in endheaders self._send_output(message_body) File "/usr/lib/python3.3/http/client.py", line 902, in _send_output self.send(msg) File "/usr/lib/python3.3/http/client.py", line 840, in send self.connect() File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 103, in connect match_hostname(self.sock.getpeercert(), self.host) File "/usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/__init__.py", line 32, in match_hostname raise ValueError("empty or no certificate") ValueError: empty or no certificate </code></pre> <p>Using <code>cURL</code> I'm able to get the expected response from the service</p> <pre><code>$ curl -k https://10.0.3.168:9001/ Please read the documentation for API endpoints </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload