Hello,
I'm trying to develop a Remove Plugin for vCenter, and found that the WebSocket was not correctly working (when proxied through vCenter).
I tried to replicate with the sample project (from vSphere-client-sdk-802.zip) and found that the project was using Spring Boot 2.0.3.
As soon as I update the dependency to 2.1.X, the WebSocket stops working.
Then, I debugged the Java program and found that Tomcat updated the way they validate one header used during the WebSocket handshake (66548 – Tomcat does not validate value of Sec-Websocket-Key header (apache.org)).
The vCenter proxy is not setting the header "Sec-Websocket-Key" to a valid value (it sets to "ZW52b3k=", "envoy" in Base64).
Also, I know there is a "bug" in the sample, a missing encodeURIComponent, and I already fixed it during my tests.
My questions is, does someone have a workaround or solution?
I tried changing the value with an interceptor but this just completely break the WebSocket connection as the value is used later.
Tomorrow, I will try to find a version of Spring 3 not using an updated Tomcat version or force a version without the patch but this is not ideal for future projects.
Example of a WebSocket UPGRADE request with the incorrect header: