Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Python 2.7.9 can cause SSL errors when connecting to REDCap #21

Open
nrejac opened this issue Mar 30, 2015 · 0 comments
Open

Using Python 2.7.9 can cause SSL errors when connecting to REDCap #21

nrejac opened this issue Mar 30, 2015 · 0 comments

Comments

@nrejac
Copy link
Contributor

nrejac commented Mar 30, 2015

Using Python 2.7.9 with GSM can cause SSL errors when connecting to REDCap. A sample stack trace:

Traceback (most recent call last):
  File "/Users/nrejack/code/nrejack/research-subject-mapper/v/bin/gsm", line 9, in 
    load_entry_point('rsm==0.10.2', 'console_scripts', 'gsm')()
  File "/Users/nrejack/code/nrejack/research-subject-mapper/v/lib/python2.7/site-packages/rsm-0.10.2-py2.7.egg/bin/generate_subject_map.py", line 55, in main
    response = rt.get_data_from_redcap(properties, logger)
  File "/Users/nrejack/code/nrejack/research-subject-mapper/v/lib/python2.7/site-packages/rsm-0.10.2-py2.7.egg/bin/utils/redcap_transactions.py", line 85, in get_data_from_redcap
    'Accept': 'text/plain'})
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 850, in _send_output
    self.send(msg)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 812, in send
    self.connect()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1212, in connect
    server_hostname=server_hostname)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 350, in wrap_socket
    _context=self)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 566, in __init__
    self.do_handshake()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 788, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

The suggested fix at this time is to use virtualenv with Python 2.7.6 or lower:

  • Check which versions of Python are installed:
    ls /usr/bin/python*
  • Check versions to find one that is suitable:
    /usr/bin/python2.7 --version 
    Python 2.7.6
    
  • Create a virtualenv with that version:
    virtualenv v -p /usr/bin/python2.7
  • Activate the virtualenv:
    source v/bin/activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant