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

2020-07-03 Thread GitBox


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.(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.internalDoFil

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

2020-07-02 Thread GitBox


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:
us...@infra.apache.org



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



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

2020-07-02 Thread GitBox


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:
us...@infra.apache.org



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