title: Bypassing SSL certificate verification using Flask, gunicorn, gevent
body: <p>I am getting CERTIFICATE_VERIFY_FAILED errors because when I make a openurl request with urllib, it is checking the https certificates, and as my endpoint is using a self signed certificate (using our companies internal CA), they are obviously failing the verification check.</p>
  <p>I know I can use requests, or create my own context, however it is a third party library that is making the call, and I can't change how that happens. As its just an internal app, I couldn't care less about the verification, so I am just happy to skip verification on all https requests.</p>
  <p>The internet suggests the easiest way to do this is, is to create an env variable <code>PYTHONHTTPSVERIFY=0</code>, or to monkey patch the ssl library with</p>
  <pre><code># Set prior to pretty much everything
  
  import ssl
  if hasattr(ssl, '_create_unverified_context'):
      ssl._create_default_https_context = ssl._create_unverified_context
  </code></pre>
  <p>So this is working fine until I go to run things using gunicorn which is configured to use gevent workers. I am also stuck using python 2.7.18</p>
  <p>Wondering if anyone has any solutions, or ideas?</p>