How to fix "bad handshake" SSLErrors when utilizing python requests
<p>I'm trying to get access to the BambooHR API (<a href="https://www.bamboohr.com/api/documentation/login.php" rel="nofollow">documentation here</a>), but I receive the following error</p>

<pre><code>    params = {
        'user': username,
        'password': password,
        'api_token': api_key}
    url = 'https://api.bamboohr.com/api/gateway.php/company/v1/login'
    r = requests.get(url, params=params)
</code></pre>

<p>Error: </p>

<pre><code>Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1580, in &lt;module&gt;
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 964, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/chriscruz/Dropbox/PycharmProjects/082716_r2/Shippy/API/bamboo_api2.py", line 31, in &lt;module&gt;
    BambooFunctions().login()
  File "/Users/chriscruz/Dropbox/PycharmProjects/082716_r2/Shippy/API/bamboo_api2.py", line 26, in login
    r = requests.get(url, params=params, auth=HTTPBasicAuth(api_key, 'api_token'))
  File "/Library/Python/2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'SSL23_GET_SERVER_HELLO', 'unknown protocol')],)",)
</code></pre>

<p>I'm unsure what this is caused by as I've re-installed OpenSSL, Requests, and not sure how to fix this issue.</p>

<p>You try by setting verify=False, use this option if you are using self-signed certificates.</p>

<p><code>r = requests.get(url, params=params, verify=False)</code></p>

<p>More info <a href="http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification" rel="nofollow">http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification</a></p>

python api openssl python-requests