modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
7.19k stars 763 forks source link

[error] handle_read_frame error: asio.ssl.stream:1 (stream truncated) #792

Closed lukeewin closed 1 year ago

lukeewin commented 1 year ago

OS: Ubuntu 22.04 Python: 3.7.16 funasr: 0.7.1 modelscope: 1.7.1

当我运行runtime/webscoket下面的C++版本的服务器端程序后,然后通过html客户端进行访问,然后报下面的错误。

asr model init finished. listen on port:10095
I20230731 13:51:07.210876 391906 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f44b0010c40
I20230731 13:51:07.210932 391906 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
[2023-07-31 13:51:07] [error] handle_transport_init received error: TLS handshake failed
[2023-07-31 13:51:07] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init (SSL routines, SSL_shutdown))
I20230731 13:51:07.348418 391909 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f4498010b70
I20230731 13:51:07.348471 391909 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
I20230731 13:51:07.416461 391917 websocket-server.cpp:112] on_open, active connections: 1
I20230731 13:51:20.955051 391913 websocket-server.cpp:181] client done
I20230731 13:51:21.123850 391890 websocket-server.cpp:88] buffer.size=258880,result json={"mode":"offline","text":"语音识别测试。","wav_name":"h5"}
[2023-07-31 13:51:25] [error] handle_read_frame error: asio.ssl.stream:1 (stream truncated)
I20230731 13:51:26.211845 391916 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f4490012710
I20230731 13:51:26.211899 391916 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
[2023-07-31 13:51:26] [error] handle_transport_init received error: TLS handshake failed
[2023-07-31 13:51:26] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init (SSL routines, SSL_shutdown))
I20230731 13:51:26.326260 391919 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f44800126a0
I20230731 13:51:26.326304 391919 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
I20230731 13:51:26.386520 391914 websocket-server.cpp:145] remove one connection 
I20230731 13:51:26.386561 391914 websocket-server.cpp:112] on_open, active connections: 1
I20230731 13:51:28.954728 391919 websocket-server.cpp:119] on_close, active connections: 1
I20230731 13:51:31.584779 391913 websocket-server.cpp:181] client done
I20230731 13:51:31.745940 391891 websocket-server.cpp:88] buffer.size=144000,result json={"mode":"offline","text":"语音识别测试。","wav_name":"h5"}
[2023-07-31 13:51:35] [error] handle_read_frame error: asio.ssl.stream:1 (stream truncated)
I20230731 13:51:39.597023 391920 websocket-server.cpp:119] on_close, active connections: 0
I20230731 13:52:50.832489 391914 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f447c0136b0
I20230731 13:52:50.832546 391914 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
[2023-07-31 13:52:50] [error] handle_transport_init received error: TLS handshake failed
[2023-07-31 13:52:50] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init (SSL routines, SSL_shutdown))
I20230731 13:52:50.943356 391910 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f44a0010c90
I20230731 13:52:50.943405 391910 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
I20230731 13:52:50.991544 391909 websocket-server.cpp:112] on_open, active connections: 1
I20230731 13:53:19.912137 391917 websocket-server.cpp:181] client done
I20230731 13:53:20.166275 391892 websocket-server.cpp:88] buffer.size=869760,result json={"mode":"offline","text":"语音识别测试。","wav_name":"h5"}
[2023-07-31 13:53:24] [error] handle_read_frame error: asio.ssl.stream:1 (stream truncated)
I20230731 13:53:27.914407 391910 websocket-server.cpp:119] on_close, active connections: 0
I20230731 13:54:06.023684 391918 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f4494010fc0
I20230731 13:54:06.023741 391918 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
[2023-07-31 13:54:06] [error] handle_transport_init received error: TLS handshake failed
[2023-07-31 13:54:06] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init (SSL routines, SSL_shutdown))
I20230731 13:54:06.145931 391917 websocket-server.cpp:25] on_tls_init called with hdl: 0x7f44880126b0
I20230731 13:54:06.145970 391917 websocket-server.cpp:26] using TLS mode: Mozilla Intermediate
I20230731 13:54:06.206161 391920 websocket-server.cpp:112] on_open, active connections: 1
I20230731 13:54:15.041986 391910 websocket-server.cpp:181] client done
I20230731 13:54:15.219712 391893 websocket-server.cpp:88] buffer.size=247680,result json={"mode":"offline","text":"语音识别测试。","wav_name":"h5"}
[2023-07-31 13:54:19] [error] handle_read_frame error: asio.ssl.stream:1 (stream truncated)
I20230731 13:54:23.042279 391911 websocket-server.cpp:119] on_close, active connections: 0

看着似乎是证书的问题的,但是我可以通过手动授权的方式进行访问,但是连接成功然后点击开始后,就会出现这个错误。这是什么问题?

zhaomingwork commented 1 year ago

客户端截图和配置贴下看看 @lukeewin

lukeewin commented 1 year ago

下面是我运行的客户端截图 image 下面是我服务端启动的配置: ./funasr-wss-server --port 10096 --download-model-dir /workspace/models --model-dir damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-onnx --vad-dir damo/speech_fsmn_vad_zh-cn-16k-common-onnx --punc-dir damo/punc_ct-transformer_zh-cn-common-vocab272727-onnx --certfile ../../../ssl_key/server.crt --keyfile ../../../ssl_key/server.key --decoder-thread-num 16 --io-thread-num 16 上面代码是经过cmake编译之后的,路径在:funasr/runtime/websocket/build/bin

zhaomingwork commented 1 year ago

看不出啥,试试电脑的浏览器看看。@lukeewin

toughhou commented 4 months ago

请问这个问题有解决方案吗?