WebSocket connection from '127.0.0.1:4708' could not be accepted - no protocols requested

I get this error when I try to access ws://127.0.0.1:8088/asterisk/ws on asterisk.
WebSocket connection from ‘127.0.0.1:4708’ could not be accepted - no protocols requested

I have enabled HTTP.conf and ari.conf, and I can access the rest of the URLs, but websocket connections are not going through. I have also tried using TLS, but I still get the same error.

also for SSL I get the following error

Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Jan 6 10:33:30] ERROR[330652]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer ‘127.0.0.1:7691’
[Jan 6 10:33:30] ERROR[330652]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error

What could be the possible solution for it?

My guess is, you have forgotten to specify a protocol name, or set of protocol names, when you initiate a WebSocket connection. If you control both ends, you can make up a custom protocol name that both ends can agree on.

I am using Postman to create a WebSocket request for testing.
But even when using Javascript I get
const ws = new WebSocket(‘http://127.0.0.1:8000/asterisk/ws’, [‘ws’]);
WebSocket connection from ‘127.0.0.1:63718’ could not be accepted - no protocols out of ‘ws’ supported

The URL for ARI would be:

http://127.0.0.1:8000/ari/events

If you are not intending to use ARI for events, then you’ll need to be more specific about what you are trying to achieve using a Websocket.