title: Python - requests.exceptions.SSLError - dh key too small
body: <p>I'm scraping some internal pages using Python and requests. I've turned off SSL verifications and warnings. </p>
  
  <pre><code>requests.packages.urllib3.disable_warnings()
  page = requests.get(url, verify=False)
  </code></pre>
  
  <p>On certain servers I receive an SSL error I can't get past.</p>
  
  <pre><code>Traceback (most recent call last):
    File "scraper.py", line 6, in &lt;module&gt;
      page = requests.get(url, verify=False)
    File "/cygdrive/c/Users/jfeocco/VirtualEnv/scraping/lib/python3.4/site-packages/requests/api.py", line 71, in get
      return request('get', url, params=params, **kwargs)
    File "/cygdrive/c/Users/jfeocco/VirtualEnv/scraping/lib/python3.4/site-packages/requests/api.py", line 57, in request
      return session.request(method=method, url=url, **kwargs)
    File "/cygdrive/c/Users/jfeocco/VirtualEnv/scraping/lib/python3.4/site-packages/requests/sessions.py", line 475, in request
      resp = self.send(prep, **send_kwargs)
    File "/cygdrive/c/Users/jfeocco/VirtualEnv/scraping/lib/python3.4/site-packages/requests/sessions.py", line 585, in send
      r = adapter.send(request, **kwargs)
    File "/cygdrive/c/Users/jfeocco/VirtualEnv/scraping/lib/python3.4/site-packages/requests/adapters.py", line 477, in send
      raise SSLError(e, request=request)
  requests.exceptions.SSLError: [SSL: SSL_NEGATIVE_LENGTH] dh key too small (_ssl.c:600)
  </code></pre>
  
  <p>This happens both in/out of Cygwin, in Windows and OSX. My research hinted at outdated OpenSSL on the server. I'm looking for a fix client side ideally. </p>
  
  <p>Edit:
  I was able to resolve this by using a cipher set</p>
  
  <pre><code>import requests
  
  requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
  try:
      requests.packages.urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST += 'HIGH:!DH:!aNULL'
  except AttributeError:
      # no pyopenssl support used / needed / available
      pass
  
  page = requests.get(url, verify=False)
  </code></pre>