title: Python SSL error Decryption failed or bad record mac
body: <p>I am trying to use <a href="https://github.com/burnash/gspread" rel="noreferrer">gspread</a> python module to read the google spreadsheet. But I am getting some error from ssl. I have tried to look into this, but couldn't able to make it work. The gspread module is using <a href="https://github.com/kennethreitz/requests" rel="noreferrer">python request</a> internally which seems to be use python's ssl package. The code (I have written) and stack trace is provided below with env details.</p>
  
  <p><strong>Env:</strong></p>
  
  <ul>
  <li>python: 2.7.13</li>
  <li>Ubuntu: 14.04</li>
  <li>openssl: 1.0.1f 6 Jan 2014</li>
  </ul>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>import gspread
  from oauth2client.client import SignedJwtAssertionCredentials
  
  scope = ['https://spreadsheets.google.com/feeds']
  credentials = SignedJwtAssertionCredentials(user_email, private_key, scope)
  google_client = gspread.authorize(credentials)
  
  
  worksheet = google_client.open_by_url(&lt;worksheet_url&gt;).get_worksheet(1)
  
  list_of_rows = worksheet.get_all_values()
  
  print list_of_rows
  </code></pre>
  
  <p><strong>Stack trace:</strong></p>
  
  <pre><code>File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "/home/nikhil/.venv/nikhil/src/gspread/gspread/models.py", line 344, in get_all_values
      cells = self._fetch_cells()
    File "/home/nikhil/.venv/nikhil/src/gspread/gspread/models.py", line 231, in _fetch_cells
      feed = self.client.get_cells_feed(self)
    File "/home/nikhil/.venv/nikhil/src/gspread/gspread/client.py", line 186, in get_cells_feed
      r = self.session.get(url)
    File "/home/nikhil/.venv/nikhil/src/gspread/gspread/httpsession.py", line 76, in get
      return self.request('GET', url, **kwargs)
    File "/home/nikhil/.venv/nikhil/src/gspread/gspread/httpsession.py", line 68, in request
      response = func(url, data=data, headers=request_headers, verify=False)
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/sessions.py", line 469, in get
      return self.request('GET', url, **kwargs)
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/sessions.py", line 457, in request
      resp = self.send(prep, **send_kwargs)
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/sessions.py", line 606, in send
      r.content
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/models.py", line 724, in content
      self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/models.py", line 653, in generate
      for chunk in self.raw.stream(chunk_size, decode_content=True):
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 256, in stream
      data = self.read(amt=amt, decode_content=decode_content)
    File "/home/nikhil/.venv/nikhil/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 186, in read
      data = self._fp.read(amt)
    File "/usr/local/lib/python2.7.13/lib/python2.7/httplib.py", line 573, in read
      return self._read_chunked(amt)
    File "/usr/local/lib/python2.7.13/lib/python2.7/httplib.py", line 642, in _read_chunked
      value.append(self._safe_read(chunk_left))
    File "/usr/local/lib/python2.7.13/lib/python2.7/httplib.py", line 688, in _safe_read
      chunk = self.fp.read(min(amt, MAXAMOUNT))
    File "/usr/local/lib/python2.7.13/lib/python2.7/socket.py", line 384, in read
      data = self._sock.recv(left)
    File "/usr/local/lib/python2.7.13/lib/python2.7/ssl.py", line 766, in recv
      return self.read(buflen)
    File "/usr/local/lib/python2.7.13/lib/python2.7/ssl.py", line 653, in read
      v = self._sslobj.read(len)
  SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1864)
  </code></pre>
  
  <p>Any help would be much appreciated.</p>
  
  <p><strong>UPDATE:</strong>
  I have setup everything from scratch on new machine and also updated the oauth client to utilize new API version. Couldn't make the above env work so keeping this question open for now.</p>