How can I programmatically enable WSS for a Tyrus WebSocket @ServerEndpoint

后端 未结 2 1149
忘了有多久
忘了有多久 2021-01-21 14:10

I have a microservice that has a REST endpoint and a WebSocket endpoint.

It Spring-wires Grizzly and Tyrus, and adds in authentication via SSO using a JAX-RS filter and

2条回答
  •  误落风尘
    2021-01-21 14:27

    I managed to get this working using a variation of the above. However, I strongly advise against it as the performance is terrible. This is nothing to do with Tyrus or Grizzly, but with Java. The SSL library in Java is notoriously slow, and since Grizzly uses Java, any WSS is going to be affected.

    Apparently Jetty and Tomcat provide a way to use OpenSSL instead of the standard Java SSL. Alternatively, use a SSL terminator (e.g. Apache web server or HAProxy) that deals with the SSL and passes a standard WS connection to your server

提交回复
热议问题