After some trial and error i managed to find the root of the problem. My tomcat server doesn't give a reason phrase for the status line:
HTTP/1.1 101 Switching Protocols
The http specification states that this is optional. The websocket implementation on the printer violates this specification. By adding the reason phrase "Switching Protocols" to the server response i could successfully connect the printer.
Fortunately apache reversed their decision to scrap these reason phrases with version 8.5.13. They can still be added with the current tomcat version 8.5.x.
(with embedded tomcat i use: ((Http11NioProtocol) tomcat.getConnector().getProtocolHandler()).setSendReasonPhrase(true);)
Tomcat 9 won't have this option available. As of now tomcat 9 won't be compatible with weblink.
Refer to 60362 – Missing reason phrase in response for discussion on this topic.