I have a FastAPI project which uses uvicorn server to run my application. speechsdk is used for Speech-to-Text operations, the endpoint I am using is "wss://eastus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US", I had a runtime error which was this: "
Runtime error: Failed to initialize platform (azure-c-shared). Error: 2153
I noticed I was using Ubuntu 22.04 LTS on my ec2. I followed the steps on: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/quickstarts/setup-platform
I encountered this error:
CancellationDetails(reason=CancellationReason.Error, error_details="Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://eastus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US
After enabling the azure logs the error logs show:
[586746]: 34602ms SPX_TRACE_ERROR: AZ_LOG_ERROR: tlsio_openssl.c:691 error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
[586746]: 34602ms SPX_TRACE_ERROR: AZ_LOG_ERROR: tlsio_openssl.c:2441 FORCE-Closing tlsio instance.
Also, my application uses a SSL certificate by LetsEncrypt and the .pem files are saved in a folder inside my application directory
I tried changing the SSL_CERT_DIR to several directories but still didn't work:
export SSL_CERT_DIR=/usr/lib/ssl/certs
Any help is appreciated!!!