title: keep getting SSL error when making a get request in python
body: <p>I'm making a simple get request as follows:</p>
  
  <pre><code>import requests
  
  response = requests.get('url')
  </code></pre>
  
  <p>And it errors out with the following output:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 417, in wrap_socket
  cnx.do_handshake()
  File "/usr/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1426, in do_handshake
  self._raise_ssl_error(self._ssl, result)
  File "/usr/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1174, in _raise_ssl_error
  _raise_current_error()
  File "/usr/lib/python3.6/site-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
  raise exception_type(errors)
  OpenSSL.SSL.Error: [('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')]
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen
  chunked=chunked)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request
  self._validate_conn(conn)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn
  conn.connect()
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 323, in connect
  ssl_context=context)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket
  return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 424, in wrap_socket
  raise ssl.SSLError('bad handshake: %r' % e)
  ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 423, in send
  timeout=timeout
  File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 624, in urlopen
  raise SSLError(e)
  requests.packages.urllib3.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 70, in get
  return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 56, in request
  return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 488, in request
  resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 609, in send
  r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 497, in send
  raise SSLError(e, request=request)
  requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
  &gt;&gt;&gt;
  </code></pre>
  
  <p>I know that to avoid it I can simply disable verification but it's definitely not the right thing to do and not the way to go, so I'd like to know if there're any other, better workarounds.</p>
  
  <p>I would appreсiate any help!</p>
  
  <p>EDIT:</p>
  
  <p>After running a test on <a href="https://www.ssllabs.com" rel="nofollow noreferrer">https://www.ssllabs.com</a> I found out that the server's certificate chain is incomplete but I have absolutely no idea how to handle this issue.</p>