snipsco / snips-nlu

Snips Python library to extract meaning from text
https://snips-nlu.readthedocs.io
Apache License 2.0
3.88k stars 515 forks source link

SSLError "Bad Handshake" error during python -m snips_nlu download-language-entities en #905

Open SamChadri opened 2 years ago

SamChadri commented 2 years ago

The Bug I seem to be getting a bad handshake error while trying to download the built-in entities. SLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)"),))

To Reproduce The error comes up when trying to parse input, and then an error occurs saying "FileNotFoundError: No data found for the 'snips/city' builtin entity in language 'en'. You must download the corresponding resources by running 'python -m snips_nlu download-entity snips/city en' before you can use this built-in entity."

Then when trying to download the SSL Bad Handshake error occurs

If successful, the command should download and link the built-in entities, but I see no documentation about it and very little help online.

Environment:

jbroeckling commented 2 years ago

seems like some protocol from "resources.snips.ai" is expired. Is there a way someone could fresh that up ?

rtkay123 commented 2 years ago

Any luck here? I also need the other entities :(

jbroeckling commented 2 years ago

Any luck here? I also need the other entities :(

so I made following UNSAFE steps to get those:

  1. go to the installed Snips Folder, e.g venv/lib/python3.9/site-packages/snips_nlu/cli/ and here you want to change the utils.py. In the "get_json" function you can change r = requests.get(url) int r = requests.get(url, verify= False)

This tells request it should ignore false and expired protocols. THIS IS PROBABLY UNSAFE. It can be used for attacks or what so ever.

  1. The second step for downloading the resources is telling pip that the unsafe protocol is okay. I did that with following command:

pip config set global.trusted-host "resources.snips.ai" --trusted-host=https://resources.snips.ai/

  1. After that the known command to download the ressources should work.

These things are very likely to be UNSAFE!!! and to update the protocol should be done.

rtkay123 commented 2 years ago

Any luck here? I also need the other entities :(

so I made following UNSAFE steps to get those:

1. go to the installed Snips Folder, e.g venv/lib/python3.9/site-packages/snips_nlu/cli/  and here you want to change the utils.py. In the "get_json" function you can change
   r = requests.get(url) int r = requests.get(url, verify= False)

This tells request it should ignore false and expired protocols. THIS IS PROBABLY UNSAFE. It can be used for attacks or what so ever.

2. The second step for downloading the resources is telling pip that the unsafe protocol is okay. I did that with following command:

pip config set global.trusted-host "resources.snips.ai" --trusted-host=https://resources.snips.ai/

3. After that the known command to download the ressources should work.

These things are very likely to be UNSAFE!!! and to update the protocol should be done.

Thanks