我有以下结构的应用程序。
loadbalancer(解析https)<->apache httpd web服务器<->apache tomcat servlet容器
我将公开在jersey实现的一些API。和招摇过市使测试更容易。
最近,我们将tomcat示例从7.x版本更新为9.x版本(9.x默认情况下已注解掉ajp)
奇怪的行为是;我试图通过swagger测试我的身份验证api。结果如下:;
chrome最新版本的403失败。我可以在tomcat的访问日志中看到403。但在我的应用程序日志中没有与此相关的日志。因此,我假设tomcat会因为一些不需要的头、道具等而拒绝请求。。。
firefox 64.0.2运行良好,能够毫无问题地调用api。但是如果我将firefox升级到72.0.2版本,那么firefox也会停止工作,请求再次以403完成。
ie工作正常:)
如果我通过机器ip地址和http访问swagger ui(这里没有https,因为在正常情况下https是在负载均衡器中解析的),那么所有浏览器都可以正常工作。
我假设chrome、https、ssl和web服务器的配置存在问题,即到达我的tomcat示例的请求有点损坏或结构错误。
场景中的一些日志也可以在这里看到。
10-Jun-2021 01:05:50.922 INFO [http-nio-8181-exec-38] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x000xa30x010x000x000x9f0x030x010xb00x160xc3iC0xce0x9f/T0x8d0xb4Q_90xed0xdd0xe00xa3[0xf80xab0xc0&0x0b0xbe0x880xd40xa0E0x880xa20x830x000x00R0xc00x0a0xc00x140x0090x0080x000x880x000x870xc00x190x00:0x000x890xc00x090xc00x130x0030x0020x000x9a0x000x990x00E0x00D0xc00x180x0040x000x9b0x00F0xc00x070xc00x110xc00x160x000x180xc00x080xc00x120x000x160x000x130xc00x170x000x1b0x0050x000x840x00/0x000x960x00A0x000x070x000x050x000x040x000x0a0x000xff0x010x000x00$0x000x0b0x000x040x030x000x010x020x000x0a0x000x0c0x000x0a0x000x1d0x000x170x000x1e0x000x190x000x180x00#0x000x000x000x160x000x000x000x170x00...]. HTTP method names must be tokens
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:417)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
10-Jun-2021 01:06:05.482 INFO [http-nio-8181-exec-1] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target [/web/#/login]. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:498)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
暂无答案!
目前还没有任何答案,快来回答吧!