dofusdude / dofusdude-py

The Python Client SDK for the Dofusdude API.
https://docs.dofusdu.de
4 stars 0 forks source link

SSL error expired certificate? #1

Open Dries08 opened 9 months ago

Dries08 commented 9 months ago

Hi there, lovely concept. I tried to use it on python and installed as instructed. When I run any of your example codes for get functions for instance: get_items_equipment_single(language, ankama_id, game) I get the following error:

Exception when calling EquipmentApi->get_items_equipment_single: HTTPSConnectionPool(host='api.dofusdu.de', port=443): Max retries exceeded with url: /dofus2/en/items/equipment/26009 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1091)')))

Am i doing something wrong of is your host down?

stelzo commented 8 months ago

Sorry for the late answer, I didn't get a notification. Have you found a solution or did you encounter the problem again since?

Dries08 commented 8 months ago

No I never managed to get past this.

stelzo commented 7 months ago

I tried a few endpoints and never got the SSL error you had. Are you behind a proxy?

The following pipeline works for me (Python 3.11.5).

python3 -m venv .
source bin/activate
pip install dofusdude

The code:

import dofusdude
from pprint import pprint

with dofusdude.ApiClient(dofusdude.Configuration(host = "https://api.dofusdu.de")) as api_client:
    api_instance = dofusdude.EquipmentApi(api_client)
    language = 'fr'
    ankama_id = 26009
    game = 'dofus2'

    try:
        api_response = api_instance.get_items_equipment_single(language, ankama_id, game)
        print("The response of EquipmentApi->get_items_equipment_single:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling EquipmentApi->get_items_equipment_single: %s\n" % e)

Can you also try the corresponding curl request?

curl -X 'GET' \
  'https://api.dofusdu.de/dofus2/fr/items/equipment/26009' \
  -H 'accept: application/json'
Dries08 commented 7 months ago

Hey there sorry I am not very familiar with curl requests so I couldn't try that. I ran the code you linked but nothing happens the file is run and appears to not finish running but does not return anything. (see image) I am using spyder through anaconda in case that might be an issue. Code_snip