Toloka / toloka-kit

Toloka-Kit is a Python library for working with Toloka API.
https://toloka.ai
Other
202 stars 34 forks source link

[BUG] Error with certificates on the new version #240

Open DaKuz47 opened 10 months ago

DaKuz47 commented 10 months ago

Observed behavior

I have all the necessary certificates When creating TolokaClient on version 0.1.22, everything works, but an error occurs on version 1.2.2. On version 1.2.2, you have to specify an explicit path to the certificate in the Toloka Client constructor

Expected behavior

No response

Python Version

3.8

Toloka-Kit Version

1.2.2

Other Packages Versions

No response

Example code

// working example on 0.1.22
toloka_client = TolokaClient(
    os.environ['TOLOKA_TOKEN'], url=args.toloka_api_url,
)

// The example above does not work on version 1.2.2
// working example on 1.2.2
toloka_client = TolokaClient(
    os.environ['TOLOKA_TOKEN'], url=args.toloka_api_url,
    verify=args.path_to_sert,
)

Relevant log output

Error accessing the Toloka API:

Exception: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)