You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/07/02 18:52:17 UTC

[GitHub] [tomcat] sephiroth-j opened a new pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

sephiroth-j opened a new pull request #311:
URL: https://github.com/apache/tomcat/pull/311


   requests with scheme "wss" or "ws", as outlined in [RFC 6455 section 11.1](https://tools.ietf.org/html/rfc6455#section-11.1), will cause an `IllegalArgumentException` with message "wsHandshakeRequest.unknownScheme" without this change.
   
   this fixes a regression from e09e6b04e41d3dae27fcfe060e6f8f89f1c0d6b5 / BZ 62731


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] sephiroth-j edited a comment on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
sephiroth-j edited a comment on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-653173711


   I observed the exception in a project with Spring Boot 2.3 and Vaadin 14.2 with an enabled [`ForwardedHeaderFilter`](https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java).
   
   The setup was Traefik as reverse proxy with TLS termination, forwarding the request from the client to the backend listening on plain HTTP. The client starts a websocket request using the URI scheme "wss://". Traefik adds the header "X-Forwared-Proto: wss" (_among others_) when forwading the request. `ForwardedHeaderFilter` alters the scheme property of the `HttpServletRequest` to the value from the "X-Forwared-Proto" header. The result is an internal server error (500) caused by that `IllegalArgumentException`.
   
   p.s.
   stracktrace of exception
   ```
   [.1-8090-exec-10] o.a.c.c.C.[.[.[.[springServlet]          : Servlet.service() for servlet [springServlet] in context with path [/] threw exception
   
   java.lang.IllegalArgumentException: wsHandshakeRequest.unknownScheme
           at org.apache.tomcat.websocket.server.WsHandshakeRequest.buildRequestUri(WsHandshakeRequest.java:162) ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
           at org.apache.tomcat.websocket.server.WsHandshakeRequest.<init>(WsHandshakeRequest.java:60) ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
           at org.apache.tomcat.websocket.server.UpgradeUtil.doUpgrade(UpgradeUtil.java:202) ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
           at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:78) ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.springframework.web.filter.ForwardedHeaderFilter.doFilterInternal(ForwardedHeaderFilter.java:158) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
           at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
           at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
           at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
           at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] markt-asf merged pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
markt-asf merged pull request #311:
URL: https://github.com/apache/tomcat/pull/311


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] sephiroth-j edited a comment on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
sephiroth-j edited a comment on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-653173711


   I observed the exception in a project with Spring Boot 2.3 and Vaadin 14.2 with an enabled [`ForwardedHeaderFilter`](https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java). The setup was Traefik as reverse proxy with TLS termination forwarding the request from the client to the backend listening on plain HTTP. The client starts a websocket request using the URI scheme "wss://". Traefik adds the header "X-Forwared-Proto: wss" (_among others_). `ForwardedHeaderFilter` alters the scheme property of the `HttpServletRequest` to the value from the "X-Forwared-Proto" header. The result is an internal server error (500) caused by that `IllegalArgumentException`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] sephiroth-j commented on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
sephiroth-j commented on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-653173711


   i observed the exception in Spring Boot Project with Vaadin with an enabled `ForwardedHeaderFilter`. The setup was Traefik as reverse proxy with TLS termination forwarding the request from the client to the backend listening on plain HTTP. The client starts a websocket request using the URI scheme "wss://". Traefik adds the header "X-Forwared-Proto: wss" (_among others_). `ForwardedHeaderFilter` alters the scheme property of the `HttpServletRequest` to the value from the "X-Forwared-Proto" header. The result is an internal server error (500) caused by that `IllegalArgumentException`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] sephiroth-j commented on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
sephiroth-j commented on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-654992932


   you are welcome


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] sephiroth-j edited a comment on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
sephiroth-j edited a comment on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-653173711


   I observed the exception in a project with Spring Boot 2.3 and Vaadin 14.2 with an enabled [`ForwardedHeaderFilter`](https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java).
   
   The setup was Traefik as reverse proxy with TLS termination, forwarding the request from the client to the backend listening on plain HTTP. The client starts a websocket request using the URI scheme "wss://". Traefik adds the header "X-Forwared-Proto: wss" (_among others_) when forwading the request. `ForwardedHeaderFilter` alters the scheme property of the `HttpServletRequest` to the value from the "X-Forwared-Proto" header. The result is an internal server error (500) caused by that `IllegalArgumentException`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat] markt-asf commented on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

Posted by GitBox <gi...@apache.org>.
markt-asf commented on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-654878703


   Thanks for the PR


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org