Handshake failed due to invalid Upgrade header: null [SPR-12371] #16978
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
Tommy Ludwig opened SPR-12371 and commented
I am running into the issue of secured WebSocket upgrade requests (over STOMP using SockJS) failing when I run my Spring application on OpenShift or CloudFoundry, though it works perfectly fine when I run it locally. I have made a simplified sample and put it on GitHub that recreates this issue. That can be found here:
https://github.com/shakuzen/spring-stomp-websocket-test
I made a StackOverflow question regarding this but have not been able to get any help so far. That is here:
http://stackoverflow.com/questions/26452632/secured-websocket-upgrade-over-stomp-via-sockjs-fails-with-invalid-upgrade-heade
I have attached the relevant portion of the local and remote (OpenShift server) logs and corresponding request headers that were sent (captured using Chrome's developer tools) when trying to connect via WebSocket. In the case of running on OpenShift, you can see just before the ERROR message, it logs the headers, which differ from the headers Chrome states are being sent. Particularly, the logged headers do not contain an upgrade attribute and the connection attribute's value is 'Keep-Alive' instead of 'Upgrade'. Additionally, it has some extra x-forwarded-* attributes.
You can see that the request headers gathered from Chrome's developer tools for local and remote are identical except for expected differences in security key and URLs and session ID.
I have gone so far as to try debugging the framework code to figure out why the headers it is failing with are not the headers I see from the browser, but I was not able to figure out why. I apologize if this is some silly mistake on my part, but I feel the sample I made is simple enough of a case that it warranted creating this issue.
Please do not hesitate to let me know if I can provide any additional information to help figure out the cause of this issue. I really appreciate any help with this even though I am sure you are busy with the upcoming release.
Affects: 4.0.7, 4.1.1
Reference URL: https://github.com/shakuzen/spring-stomp-websocket-test
Attachments:
The text was updated successfully, but these errors were encountered: