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

SSL error #5

Closed
mmyslin opened this issue Sep 23, 2014 · 3 comments
Closed

SSL error #5

mmyslin opened this issue Sep 23, 2014 · 3 comments

Comments

@mmyslin
Copy link

mmyslin commented Sep 23, 2014

I seem to have installed this successfully, but I can't actually get any data from MFP. The credentials below are correct for a dummy account I set up:

import myfitnesspal
client = myfitnesspal.Client('dummyaccount123', 'password')
Traceback (most recent call last):
File "", line 1, in
File "myfitnesspal/client.py", line 38, in init
self._login()
File "myfitnesspal/client.py", line 42, in _login
document = self._get_document_for_url(login_url)
File "myfitnesspal/client.py", line 83, in _get_document_for_url
content = self._get_content_for_url(url)
File "myfitnesspal/client.py", line 80, in _get_content_for_url
return self.session.get(url).content.decode('utf8')
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg/requests/sessions.py", line 347, in get
return self.request('GET', url, *_kwargs)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg/requests/sessions.py", line 335, in request
resp = self.send(prep, *_send_kwargs)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg/requests/sessions.py", line 438, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/requests-1.2.3-py2.7.egg/requests/adapters.py", line 331, in send
raise SSLError(e)
requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm

@mmyslin
Copy link
Author

mmyslin commented Sep 24, 2014

Note: I'm no longer trying to use this library -- I'm now just scraping data off of my public MFP website.

@coddingtonbear
Copy link
Owner

Ahh, well, keep in mind that scraping is exactly what this library is doing, too, since the API MyFitnessPal provides is closed.

So, re: your SSL connection error -- that looks like your version of Python was compiled against an outdated version of OpenSSL. Unfortunately that kind of thing is totally out of my hands -- all this library does is tell Python to connect to a specific host using HTTPS; whether or not that connection is possible is unfortunately up to whether or not the underlying library (OpenSSL) can pull it off.

You can find a little discussion about the underlying problem on this pip bug; although they're working through the issue on a different library, the bug and root cause are the same. I'm afraid I'm not sure where to begin in instructing you on how to re-build Python against a more modern version of OpenSSL, but let me know if you have any other questions.

Cheers!

@mmyslin
Copy link
Author

mmyslin commented Sep 24, 2014

Okay, this is helpful -- thanks for the reply!

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

2 participants