-
Notifications
You must be signed in to change notification settings - Fork 75
Long cookie leads to handshake fail #72
Comments
Hi, Did you confirm your HTTP Request have header greater than 2048 bytes ? The |
Hi Pierozi, @Pierozi Yes, my request header is greater than 2048 bytes because of encrypted cookie string. I think taking all header is better until get "sec-websocket-key". We encountered this issue on production environment, and it's really tough to me. And, we temporarily solved by Cross-Origin: changing Domain into IP, so that the http request won't pass long cookie. |
@Pierozi Do you think this is an issue for |
@Hywan I guess yes, because we consider the responsibility of extract http header from In short time, maybe we can do a quick patch by moving 2048 as class parameter. |
@Pierozi Agree. Could you write the PRs and open the respective issues? |
Hello @hhxsv5 can you tell us what's the size of your header or provide us an example. |
Same issue happens for me. GET /?token=tokentokentokentokendaipps0QKwHF__1507723994 HTTP/1.1
Host: host.hosthost.com:port
Pragma: no-cache
Cache-Control: no-cache
Origin: https://origin.originorigi.co
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: nb-NO,nb;q=0.8,no;q=0.6,nn;q=0.4,en-US;q=0.2,en;q=0.2
Cookie: _csrf=5a1de5518e830f911089483d8ba8d724085da4527db73744d61102c1e47742eca%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%222iFzRjpGxNX8uD7EgO82Op6HroGPQcZw%22%3B%7D; ids_for_initial_open930={"locations":["2147"],"sets":["873"]}; ids_for_initial_open1031={"locations":["2423"],"sets":["971"]}; ids_for_initial_open1026={"locations":["2417"],"sets":["966"]}; ids_for_initial_open1025={"locations":["2415"],"sets":["965"]}; ids_for_initial_open1036={"locations":["2451"],"sets":["976"]}; ids_for_initial_open1051={"locations":["2476"],"sets":["990"]}; ids_for_initial_open1042={"locations":["2461"],"sets":["981"]}; ids_for_initial_open1030={"locations":["2422"],"sets":["970"]}; ids_for_initial_open1029={"locations":["2420"],"sets":["969"]}; ids_for_initial_open1086={"locations":["2584","2585"],"sets":["1020"]}; ids_for_initial_open468={"locations":["1189"],"sets":["448"]}; ids_for_initial_open1024={"locations":["2413"],"sets":["964"]}; _ga=GA1.2.396346604.1504076802; _gid=GA1.2.289453770.1507618974; _gat=1; menu-state=collapsed; PHPSESSID=7p0c1i26b3dop2tcq1fjqn4fm1; authToken=1k-0QK4lir8Hl0_rIS53daipps0QKwHF__1507723994; _identity=8a87ba293fe1fff808a42c816cc63f29fac3419800739442443c2b3f4596a994a%3A2%3A%7Bi%3A0%3Bs%3A9%3A%22_identity%22%3Bi%3A1%3Bs%3A19%3A%22%5B2433%2Cnull%2C2592000%5D%22%3B%7D
Sec-WebSocket-Key: gdwp6V7NlollUDIVciEO6w==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
X-Forwarded-For: 11.111.111.93
X-Forwarded-Host: host.hosthoste.co:8443
X-Forwarded-Server: ip-111-11-11-7.eu-west-1.compute.internal
Upgrade: WebSocket
Connec |
I can work around this by setting up an apache websocket proxy. Example config:
|
Hello guys.
When create websocket request with long long cookie, i will get a handshake fail error as the following.
WebSocket connection to 'ws://xxx.com:8088/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
I found out the reason: read 2048 bytes only, cannot get the header "sec-websocket-key".
Any ideas ?
The text was updated successfully, but these errors were encountered: