# elb ssl termination for wss websocket fails net::ERR\_RESPONSE\_HEADERS\_TRUNCATED

**URL:** <https://community.wowza.com/t/elb-ssl-termination-for-wss-websocket-fails-net-err-response-headers-truncated/47166>\
**Category:** Wowza Streaming Engine\
**Created:** [November 13, 2016, 6:05am UTC](https://community.wowza.com/t/elb-ssl-termination-for-wss-websocket-fails-net-err-response-headers-truncated/47166 "2016-11-13T06:05:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Art\_Vanderhoffer](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Art\_Vanderhoffer](https://community.wowza.com/u/Art_Vanderhoffer)\
**Post date:** [November 13, 2016, 6:05am UTC](https://community.wowza.com/t/elb-ssl-termination-for-wss-websocket-fails-net-err-response-headers-truncated/47166/1 "2016-11-13T06:05:37Z")

</div>

I am trying to get a websocket communication working through a classic ELB with ssl termination to wowza, a java based media server.

Setup

```auto
VPC
R53
test.myTld.com 
IPv4, Alias=Yes, Target myElb, Routing Simple
CLASSIC ELB: myElb
listeners: SSL 64443 -> TCP 64443 : SSL Cert managed by AWS Certificate Manager (ACM)
security group [sg-xxxxx] : Custom TCP Rule TCP (6) 64443 0.0.0.0/0
EC2 
security group [sg-xxxxx] : Custom TCP Rule TCP (6) 64443 0.0.0.0/0

```

When connecting to ec2 wowza using direct ip, the connection works and stream connects

> wss://xxx.xxx.xxx.xxx:64443/webrtc-session.json

> Frames = {status: 200, statusDescription: “OK”, direction: “publish”, command: “sendOffer”,…}

However connecting through the ELB I get different errors being reported

```auto
WebSocket connection to 'wss://test.myTld.com:64443/webrtc-session.json' 
failed: Error during WebSocket handshake: net::ERR_RESPONSE_HEADERS_TRUNCATED

```

So following several tutorials & docs such as [http://docs.aws.amazon.com/cli/latest/reference/elb/set-load-balancer-policies-of-listener.html](http://docs.aws.amazon.com/cli/latest/reference/elb/set-load-balancer-policies-of-listener.html) I added the following

```auto
aws elb create-load-balancer-policy --load-balancer-name myElb --policy-name wowza --policy-type-name ProxyProtocolPolicyType --policy-attributes AttributeName=ProxyProtocol,AttributeValue=True
aws elb set-load-balancer-policies-for-backend-server --load-balancer-name myElb --instance-port 64443 --policy-names wowza

```

Confriming the policy has been updated,

```auto
aws elb describe-load-balancers --load-balancer-name myElb
"VPCId": "vpc-xxxxxxxx", 
"BackendServerDescriptions": [
 {
   "InstancePort": 64443, 
   "PolicyNames": [
                   "wowza"
                  ]
                }
            ], 
            "Instances": [
                {
                    "InstanceId": "i-xxxxxxx"
                }
            ], 

```

I then try a connection using the [test.myTld.com](http://test.myTld.com) & ELB, the first try reports

```auto
WebSocket connection to 'wss://test.myTld.com:64443/webrtc-session.json'
failed: Error during WebSocket handshake: Invalid status line
Frames = (Opcode -1)

```

then subsequent tries report

```auto
WebSocket connection to 'wss://test.myTld.com:64443/webrtc-session.json'
failed: Error during WebSocket handshake: net::ERR_RESPONSE_HEADERS_TRUNCATED
Frames = (Opcode -1)

```

For what it is worth, here is the logs from wowza

```auto
server INFO 200 - WebSocketSession.create[94728968] - - - 9432.997
server INFO 200 - WebSocketSession.destroy[926674790]: source:server status:-1 description:Unknown - - - 9490.999

```

So my questions is what else do I need to set for the ELB to pass the wss headers to establish the websocket.

Thx

Art

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [December 30, 2016, 4:58pm UTC](https://community.wowza.com/t/elb-ssl-termination-for-wss-websocket-fails-net-err-response-headers-truncated/47166/2 "2016-12-30T16:58:49Z")

</div>

Hi Art,

It would be best if we can look at your Wowza and ELB configuration. Do please [create a support ticket](https://www.wowza.com/support/open-ticket) so that we can review this.

Michelle
