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

Certificate Verify Failed #1137

Closed
SLong97 opened this issue Sep 8, 2022 · 4 comments
Closed

Certificate Verify Failed #1137

SLong97 opened this issue Sep 8, 2022 · 4 comments

Comments

@SLong97
Copy link

SLong97 commented Sep 8, 2022

Apologies if this is not the appropriate place to ask but when trying to use Vosk I am running into the following error:

vosk-model-en-us-0.22.zip: 0.00B [00:00, ?B/s]
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1010, in _send_output
    self.send(msg)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 950, in send
    self.connect()
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1424, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)

During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "C:/Users/user/Desktop/podcast-summary/start.py", line 9, in <module>
    model = Model(model_name="vosk-model-en-us-0.22")
  File "C:\Users\user\Desktop\podcast-summary\env\lib\site-packages\vosk\__init__.py", line 50, in __init__
    model_path = self.get_model_path(model_name, lang)
  File "C:\Users\user\Desktop\podcast-summary\env\lib\site-packages\vosk\__init__.py", line 65, in get_model_path
    model_path = self.get_model_by_name(model_name)
  File "C:\Users\user\Desktop\podcast-summary\env\lib\site-packages\vosk\__init__.py", line 81, in get_model_by_name
    self.download_model(Path(directory, result_model[0]))
  File "C:\Users\user\Desktop\podcast-summary\env\lib\site-packages\vosk\__init__.py", line 106, in download_model
    urlretrieve(MODEL_PRE_URL + str(model_name.name) + '.zip', str(model_name) + '.zip', 
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 247, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 1393, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 1353, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)>
Exception ignored in: <function Model.__del__ at 0x000002274FE3D3A0>
Traceback (most recent call last):
  File "C:\Users\user\Desktop\podcast-summary\env\lib\site-packages\vosk\__init__.py", line 56, in __del__
    _c.vosk_model_free(self._handle)
AttributeError: 'Model' object has no attribute '_handle'

Process finished with exit code 1

I was wondering if anyone could offer a solution to this problem I am facing, any help would be greatly appreciated.

@nshmyrev
Copy link
Collaborator

nshmyrev commented Sep 8, 2022

update root ssl certificates or download model from website and use directly

@nshmyrev
Copy link
Collaborator

nshmyrev commented Sep 8, 2022

Same as #1015

@nshmyrev nshmyrev closed this as completed Sep 8, 2022
@SLong97
Copy link
Author

SLong97 commented Sep 8, 2022

Thank you so very much for the quick response.

Just in case anyone else runs into this same issue, this is how I obtained the relevant certificate:

  • Run Internet Explorer as administrator
  • Navigate to https://alphacephei.com/vosk/
  • Click on lock icon by the search bar
  • Select view certificates and then select install certificate

@sam1am
Copy link

sam1am commented Jul 29, 2023

Does not work for me. I can't even launch Internet Explorer, and trying this in Edge there is no option to install the certificate.

What worked is downloading the model from here: https://alphacephei.com/vosk/models

and then defining it in the command like this:

vosk-transcriber -i .\audio-2023-07-23-12-14-03.mp3 -o test.txt -m E:\Downloads\vosk-model-en-us-0.22-lgraph

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

No branches or pull requests

3 participants