Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Websocket requests receiving 400 Bad Request based on size
Author Message
pgrebenc
Brekeke Newbie


Joined: 10 Aug 2015
Posts: 4

PostPosted: Tue May 09, 2017 11:21 am    Post subject: Websocket requests receiving 400 Bad Request based on size Reply with quote

1. Brekeke Product Name and Version: 3.5.3.0

2. Java version: 1.8.0_66

3. OS type and the version: CentOS 6

4. UA (phone), gateway or other hardware/software involved: JsSIP 0.7.23

5. Your problem:

I have noticed that occasionally a 400 Bad Request response is received when a websocket connection is attempted to the Brekeke SIP server. I have tracked this down to the size of either the total request, or the size of the cookie header in the request.

We are currently hosting web applications on the same host with the SIP server websocket endpoint. Therefore, any cookies applicable to the host are also included in the websocket requests sent to the SIP server.

Through testing, I was able to cause a request to fail, and I have copied an example below (modified only to blank out the host fields), along with the response from the Brekeke server. If this same request is sent with the cookie value one character less, the websocket connection is successful.

Our cookie header length is well within the minimum recommended limits specified in RFC 6265. Is there anything that we can do to allow these requests to be supported?


GET https://xxx.xxxxxxxxxxx.xxxxxxxx.xxx:10081/ HTTP/1.1
Host: xxx.xxxxxxxxxxx.xxxxxxxx.xxx:10081
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: https://xxx.xxxxxxxxxxx.xxxxxxxx.xxx
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8
Cookie: foo=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sec-WebSocket-Key: eZi8jjUjs/i2ATV8/i0aow==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Sec-WebSocket-Protocol: sip



HTTP/1.1 400 Bad Request
Server: Brekeke SIP Server rev.424
Date: Tue, 09 May 2017 15:47:26 GMT
Content-Type: text/html
Content-Length: 155

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>400 Bad Request</h1>
</body></html>
Back to top
View user's profile
lakeview
Brekeke Master Guru


Joined: 15 Nov 2007
Posts: 319
Location: Florida

PostPosted: Tue May 09, 2017 2:44 pm    Post subject: Reply with quote

HTTP request's packet buffer size for WebSocket is 700 byte.

So resize the Cookie data to meet this limitation.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1