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? #2

Closed
nyarenbee opened this issue Aug 17, 2017 · 4 comments
Closed

SSL error? #2

nyarenbee opened this issue Aug 17, 2017 · 4 comments

Comments

@nyarenbee
Copy link

Got SSL Error while running the script fom MAC; Any idea:

Traceback (most recent call last):
  File "playersPickedInLeague.py", line 82, in <module>
    getPlayersInfo()
  File "playersPickedInLeague.py", line 20, in getPlayersInfo
    r = requests.get(PLAYERS_INFO_URL, verify=False)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='fantasy.premierleague.com', port=443): Max retries exceeded with url: /drf/bootstrap-static (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
~ 
@spinach
Copy link
Owner

spinach commented Aug 17, 2017

Does it always gives you this error even if you retry multiple times? Did it ever work before?
Check this SO issue, it might be helpful https://stackoverflow.com/a/24899222/905425

The script works on my side with no problem (just tried it). It seems more of a Connection / Environment Python problem, and not related to this library, so I suggest you google the error and try to find an answer in SO 😄

@spinach
Copy link
Owner

spinach commented Aug 17, 2017

You can re-open the issue if you have more questions

@spinach spinach closed this as completed Aug 17, 2017
@spinach
Copy link
Owner

spinach commented Aug 17, 2017

After investigating more, it seems it is an SSL problem. Fantasy PL website seem to have updated their minimum SSL connection requirements.

In your terminal, run python -c "import ssl; print ssl.OPENSSL_VERSION". If you get 0.9.8 and not 1.0.1, then you need to upgrade the ssl version used by Python. You can google/SO to find how to do it

@spinach spinach reopened this Aug 17, 2017
@spinach
Copy link
Owner

spinach commented Aug 17, 2017

So I checked that it worked in Python 3 as it uses the correct OpenSSL version. So you can follow the instructions in the branch python3. Just tested it, it works.

@spinach spinach closed this as completed Aug 17, 2017
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