title: Python 3 urllib ignore SSL certificate verification
body: <p>I have a server setup for testing, with a self-signed certificate, and want to be able to test towards it.</p>
  
  <p><strong>How do you ignore SSL verification in the Python 3 version of <code>urlopen</code>?</strong></p>
  
  <p>All information I found regarding this is regarding <code>urllib2</code> or Python 2 in general.</p>
  
  <p><code>urllib</code> in python 3 has changed from <code>urllib2</code>:</p>
  
  <p><strong>Python 2, urllib2</strong>: <code>urllib2.urlopen(url[, data[, timeout[, cafile[, capath[, cadefault[, context]]]]])</code></p>
  
  <p><a href="https://docs.python.org/2/library/urllib2.html#urllib2.urlopen" rel="noreferrer">https://docs.python.org/2/library/urllib2.html#urllib2.urlopen</a></p>
  
  <p><strong>Python 3</strong>: <code>urllib.request.urlopen(url[, data][, timeout])</code>
  <a href="https://docs.python.org/3.0/library/urllib.request.html?highlight=urllib#urllib.request.urlopen" rel="noreferrer">https://docs.python.org/3.0/library/urllib.request.html?highlight=urllib#urllib.request.urlopen</a></p>
  
  <p>So I know this can be done in Python 2 in the following way. However Python 3 <code>urlopen</code> is missing the context parameter.</p>
  
  <pre><code>import urllib2
  import ssl
  
  ctx = ssl.create_default_context()
  ctx.check_hostname = False
  ctx.verify_mode = ssl.CERT_NONE
  
  urllib2.urlopen("https://your-test-server.local", context=ctx)
  </code></pre>
  
  <p>And yes I know this is a bad idea. This is only meant for testing on a private server.</p>
  
  <p>I could not find how this is supposed to be done in the Python 3 documentation, or in any other question. Even the ones explicitly mentioning Python 3, still had a solution for urllib2/Python 2.</p>