Bad handshake: Error while using request in python
<p>Here iam using a request module to download the api information from github and code is shown below.</p>

<pre><code># Creation of Github request

# Import requests
import requests

r = requests.get('https://api.github.com/user', auth=('user','pass'))
print(r.status_code)
print(r.headers['content-type'])
print(r.encoding)
print(r.text)
print(r.json())
</code></pre>

<p>While using this module there is a error </p>

<pre><code>python github.py           
Traceback (most recent call last):
  File "github.py", line 6, in &lt;module&gt;
    r = requests.get('https://api.github.com/user', auth=('user','pass'))
  File "/home/ubuntu/.local/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/home/ubuntu/.local/lib/python2.7/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')],)",)
</code></pre>

<p>What i have tried:</p>

<p>Replaced the username and password with my authentation details and it gave the following error.</p>

<pre><code>401
application/json; charset=utf-8
utf-8
{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
{u'documentation_url': u'https://developer.github.com/v3', u'message': u'Bad credentials'}
</code></pre>

<p>Tried to work with access token in the settings tab of github but it was no use.</p>

<p>Any help? Please help me solve this problem.</p>

<p>Also requests modules is installed on my system.</p>