Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Urlretrieve usage causes certificate error #1456

Closed
yilun11 opened this issue Oct 31, 2023 · 5 comments
Closed

Urlretrieve usage causes certificate error #1456

yilun11 opened this issue Oct 31, 2023 · 5 comments

Comments

@yilun11
Copy link

yilun11 commented Oct 31, 2023

Related to issue #1015, I think the problem is line 117 in vosk-api\python\vosk\_init_.py

urlretrieve(MODEL_PRE_URL + str(model_name.name) + ".zip", str(model_name) + ".zip", reporthook=reporthook, data=None)

An alternative like requests.get() works fine.

To replicate (on Windows, Py 3.11.5) following throws CERTIFICATE_VERIFY_FAILED:

from urllib.request import urlretrieve

urlretrieve("https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip", "d:\temp.zip")

This does not throw the error:

import requests

file = requests.get("https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip")
@nshmyrev
Copy link
Collaborator

What is Windows version please? something very old?

@yilun11
Copy link
Author

yilun11 commented Oct 31, 2023

I am on Windows 11 Home Version 10.0.22624 Build 22624. I've seen other issues with certs, and think requests with certifi is the better approach.

@nshmyrev
Copy link
Collaborator

Ok, thanks. I can check a bit later if time permits. Getting a good certificate from proper authority is the right way of course.

@yilun11
Copy link
Author

yilun11 commented Nov 1, 2023

I think the certificate has the cross signed with expired DST Root CA X3 issue, which would explain the expiration error thrown. Unsure if this is a known issue on urllib and resolved in requests on the Windows platform.

@nshmyrev
Copy link
Collaborator

Same as #1137

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants