Connection error for betfairlightweight

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • develop
    Junior Member
    • Jun 2021
    • 1

    #1

    Connection error for betfairlightweight

    I have been trying to use the betfairAPI (in python specifcailly using the betfairlightweight) but I haven't been successful in setting up communication yet.

    The code I am trying to run is:
    "trading = betfairlightweight.APIClient(username=my_username,
    password=my_password,
    app_key=my_app_key,
    certs=certs_path)

    trading.login() "

    (Line 30 of my code is the trading.login() )

    When I run my code I get an error of
    "...
    Traceback (most recent call last):
    File "C:\...\Python\Python39\lib\sit e-packages\betfairlightweight\endpoints\login.py", line 44, in request
    response = session.post(
    File "C:\...\Python39\lib\sit e-packages\requests\api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
    File "C:\...\Python39\lib\sit e-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
    File "C:\...\Python39\lib\sit e-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
    File "C:\...\Python39\lib\sit e-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
    File "C:\...\Python39\lib\sit e-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
    requests.exceptions.SSLError: HTTPSConnectionPool(host='identitysso-cert.betfair.com', port=443): Max retries exceeded with url: /api/certlogin (Caused by SSLError(SSLError(9, '[SSL] PEM lib (_ssl.c:4044)')))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\...\Betting\bettingAPIbetfairlightweight .py", line 30, in <module>
    trading.login()
    File "C:\...\Python39\lib\sit e-packages\betfairlightweight\endpoints\login.py", line 30, in __call__
    (response, response_json, elapsed_time) = self.request(
    File "C:\...\Python39\lib\sit e-packages\betfairlightweight\endpoints\login.py", line 51, in request
    raise APIError(None, exception=e)
    betfairlightweight.exceptions.APIError: None
    Params: None
    Exception: HTTPSConnectionPool(host='identitysso-cert.betfair.com', port=443): Max retries exceeded with url: /api/certlogin (Caused by SSLError(SSLError(9, '[SSL] PEM lib (_ssl.c:4044)')))"

    (I have cropped the paths in the error but hopefully it is still understandable)

    Any help would be appreciated.
  • LiamP
    Junior Member
    • Oct 2015
    • 284

    #2
    Join the slack group and have a search as someone posted his question and solved it last week.

    https://betfairlightweight.herokuapp.com/

    Comment

    • ps2023
      Junior Member
      • Apr 2023
      • 2

      #3
      Did you solve this? What was the solution?

      Comment

      • Museem
        Junior Member
        • Apr 2023
        • 1

        #4
        Originally posted by LiamP View Post
        Join the slack group and have a search as someone posted his question and solved it last week.

        https://betfairlightweight.herokuapp.com/geometry dash

        Thank bro.

        Comment

        Working...
        X