vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Problem with certificate ...

Open ChameleonRed opened this issue 2 years ago • 9 comments

D:\video\professional programming\011 Jak zostać programistą\render> vosk-transcriber -i "011 - Jak zostać programistą.ac3" -l pl vosk-model-small-pl-0.22.zip: 0.00B [00:00, ?B/s] Traceback (most recent call last): File "C:\root\Python\Python310\lib\urllib\request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\root\Python\Python310\lib\http\client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\root\Python\Python310\lib\http\client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\root\Python\Python310\lib\http\client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\root\Python\Python310\lib\http\client.py", line 1037, in _send_output self.send(msg) File "C:\root\Python\Python310\lib\http\client.py", line 975, in send self.connect() File "C:\root\Python\Python310\lib\http\client.py", line 1454, in connect self.sock = self._context.wrap_socket(self.sock, File "C:\root\Python\Python310\lib\ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "C:\root\Python\Python310\lib\ssl.py", line 1071, in _create self.do_handshake() File "C:\root\Python\Python310\lib\ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\root\Python\Python310\lib\runpy.py", line 196, in run_module_as_main return run_code(code, main_globals, None, File "C:\root\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\root\Python\Python310\Scripts\vosk-transcriber.exe_main.py", line 7, in File "C:\root\Python\Python310\lib\site-packages\vosk\transcriber\cli.py", line 62, in main transcriber = Transcriber(args) File "C:\root\Python\Python310\lib\site-packages\vosk\transcriber\transcriber.py", line 16, in init self.model = Model(model_path=args.model, model_name=args.model_name, lang=args.lang) File "C:\root\Python\Python310\lib\site-packages\vosk_init.py", line 50, in init model_path = self.get_model_path(model_name, lang) File "C:\root\Python\Python310\lib\site-packages\vosk_init.py", line 63, in get_model_path model_path = self.get_model_by_lang(lang) File "C:\root\Python\Python310\lib\site-packages\vosk_init_.py", line 97, in get_model_by_lang self.download_model(Path(directory, result_model[0])) File "C:\root\Python\Python310\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:\root\Python\Python310\lib\urllib\request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: File "C:\root\Python\Python310\lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) File "C:\root\Python\Python310\lib\urllib\request.py", line 519, in open response = self._open(req, data) File "C:\root\Python\Python310\lib\urllib\request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "C:\root\Python\Python310\lib\urllib\request.py", line 496, in _call_chain result = func(*args) File "C:\root\Python\Python310\lib\urllib\request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, File "C:\root\Python\Python310\lib\urllib\request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (ssl.c:997)> Exception ignored in: <function Model.del at 0x00000204A350F2E0> Traceback (most recent call last): File "C:\root\Python\Python310\lib\site-packages\vosk_init.py", line 56, in del _c.vosk_model_free(self._handle) AttributeError: 'Model' object has no attribute '_handle'

ChameleonRed avatar Jun 11 '22 22:06 ChameleonRed

Windows 10, Python 3.10.x, Python 3.8.x

ChameleonRed avatar Jun 11 '22 22:06 ChameleonRed

This helps but it is wrong. Next problem is lack of ffmpeg.

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

You should report where is problem with url or with lack of tool. For me it is clear since I am programmer but need more time to find problem.

For others is unbreakable limitation.

ChameleonRed avatar Jun 11 '22 22:06 ChameleonRed

@vadimdddd check presence of ffmpeg

nshmyrev avatar Jun 12 '22 15:06 nshmyrev

It is not ffmpeg but URL.

ChameleonRed avatar Jun 13 '22 00:06 ChameleonRed

There is also problem with ffmpeg - it is different story - same unclear message. I added path to ffmpeg for second problem but it not solve problem with certificate since URL is not releted to ffmpeg but model.

You can have problem with certificate in chain - not with site certificate.

ChameleonRed avatar Jun 13 '22 00:06 ChameleonRed

Our certificate is ok, its most likely python certificates need update due to letsencrypt root certificate isse. Check from the browser, it is fine.

You can also check https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

nshmyrev avatar Jun 13 '22 12:06 nshmyrev

I will check if it helps. I found that your certificate is good so it can be certificate chain problem.

ChameleonRed avatar Jun 20 '22 19:06 ChameleonRed

I'm also facing the same problem! For https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip, Google Chrome says that the site is not secure.

Am I missing something? Is there a way to fix it?

Edit: Not a pressing problem as one can manually download the model, extract it and drop it in /.cache/vosk, but it'll be nice for the auto-downloading to work

Nicholas-Ho avatar Jun 25 '22 17:06 Nicholas-Ho

@Nicholas-Ho could you please click on the lock near website address and show the certificate information?

https://superuser.com/questions/1160502/how-to-view-ssl-certificate-details-on-chrome

nshmyrev avatar Jun 25 '22 20:06 nshmyrev

How to fix:

https://github.com/alphacep/vosk-api/issues/1137#issuecomment-1240789686

nshmyrev avatar Nov 14 '22 20:11 nshmyrev