# 31910: Stream - WebSocket - SSL Protocol Error

Log Type: APPLICATION

Log Level: ERROR

## Description

This error occurs when Twilio can't establish the secure WebSocket connection required for Media Streams. `<Stream>` supports only `wss`, so your WebSocket endpoint must accept a secure connection before Twilio can begin streaming audio.

### Possible causes

* The `<Stream>` `url` points to an endpoint that does not support `wss`.
* The WebSocket server is listening on the wrong port, or the port in the `<Stream>` `url` is not configured for TLS.
* The server certificate is not valid or is not accepted by standard HTTP clients, so the SSL handshake fails.
* A firewall or proxy is blocking secure WebSocket traffic to your public endpoint on port 443.

### Possible solutions

* Update the `<Stream>` `url` to use a reachable `wss` endpoint. Do not use `ws`.
* Configure your WebSocket server to accept secure connections on the port referenced in the `<Stream>` `url`. Media Streams requires secure WebSocket connectivity on port 443.
* Install or correct the TLS certificate so the endpoint presents a valid certificate that standard HTTP clients accept.
* Update your firewall or proxy rules to allow secure WebSocket connections from Twilio to your WebSocket server.

#### Additional resources

* [Media Streams Overview](/docs/voice/media-streams)
* [TwiML Voice: `<Stream>`](/docs/voice/twiml/stream)
* [Media Streams Configuration](/docs/global-infrastructure/firewall-configurations/media-streams-configuration)
