当前位置: 首页 > 知识库问答 >
问题:

启用https时Spring Cloud网关丢失响应(有时)

归松
2023-03-14

编辑:已解决。正在使用spring-boot 2.1.0运行网关,升级到2.1.3并修复了该问题。

移植遗留的grails应用程序以运行在spring cloud gateway代理之后。在HTTP上似乎运行良好,但当我们启用SSL并使用HTTPS时,我们会看到间歇性错误。

  • 端口8443
  • 上运行的网关
  • MyApp在端口9006
  • 上运行

网关配置摘录:

server:
  ssl:
    enabled: true
    key-alias: localhost
    key-store-password: changeit
    key-store: keystore.jks
    key-store-type: JKS
    key-password: blahblah
spring:
  cloud:
    gateway:    
      httpclient:
        ssl:
          trustedX509Certificates:
          - certs.pem         
          handshakeTimeoutMillis: 10000
          closeNotifyFlushTimeoutMillis: 3000
          closeNotifyReadTimeoutMillis: 0

      routes:
       - id: myApp
         uri: https://localhost:9006
         predicates:
         - Path=/myApp/**
         filters:
         - RewritePath=/(?<segment>.*), /$\{segment}

启动网关和应用程序,并尝试导航到https://localhost:8443/myapp会导致浏览器挂起,并且从未收到响应。网关日志显示:

[]: 2019-03-12 13:02:17.101 [reactor-http-nio-4] DEBUG r.n.t.SslProvider [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] SSL enabled using engine SSLEngineImpl
[]: 2019-03-12 13:02:17.102 [reactor-http-nio-5] DEBUG r.n.t.SslProvider [id: 0xedd15d59, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63099] SSL enabled using engine SSLEngineImpl
[]: 2019-03-12 13:02:17.102 [reactor-http-nio-4] DEBUG r.n.h.s.HttpServerOperations [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] New http connection, requesting read
[]: 2019-03-12 13:02:17.102 [reactor-http-nio-5] DEBUG r.n.h.s.HttpServerOperations [id: 0xedd15d59, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63099] New http connection, requesting read
[]: 2019-03-12 13:02:17.102 [reactor-http-nio-4] DEBUG r.n.c.BootstrapHandlers [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] Initialized pipeline DefaultChannelPipeline{(reactor.left.sslHandler = io.netty.handler.ssl.SslHandler), (reactor.left.sslReader = reactor.netty.tcp.SslProvider$SslReadHandler), (BootstrapHandlers$BootstrapInitializerHandler#0 = reactor.netty.channel.BootstrapHandlers$BootstrapInitializerHandler), (reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.accessLogHandler = reactor.netty.http.server.AccessLogHandler), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
[]: 2019-03-12 13:02:17.102 [reactor-http-nio-5] DEBUG r.n.c.BootstrapHandlers [id: 0xedd15d59, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63099] Initialized pipeline DefaultChannelPipeline{(reactor.left.sslHandler = io.netty.handler.ssl.SslHandler), (reactor.left.sslReader = reactor.netty.tcp.SslProvider$SslReadHandler), (BootstrapHandlers$BootstrapInitializerHandler#0 = reactor.netty.channel.BootstrapHandlers$BootstrapInitializerHandler), (reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.accessLogHandler = reactor.netty.http.server.AccessLogHandler), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
[]: 2019-03-12 13:02:17.118 [reactor-http-nio-4] TRACE r.n.c.ChannelOperationsHandler [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] End of the pipeline, User event SslHandshakeCompletionEvent(SUCCESS)
[]: 2019-03-12 13:02:17.119 [reactor-http-nio-5] TRACE r.n.c.ChannelOperationsHandler [id: 0xedd15d59, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63099] End of the pipeline, User event SslHandshakeCompletionEvent(SUCCESS)
[]: 2019-03-12 13:02:17.120 [reactor-http-nio-4] DEBUG r.n.h.s.HttpServerOperations [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] Increasing pending responses, now 1
[]: 2019-03-12 13:02:17.120 [reactor-http-nio-4] DEBUG r.n.h.s.HttpServer [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@e5aca0f
[]: 2019-03-12 13:02:17.126 [reactor-http-nio-3] DEBUG r.n.r.PooledConnectionProvider [id: 0x73262664, L:/127.0.0.1:63086 - R:localhost/127.0.0.1:9006] Channel acquired, now 1 active connections and 0 inactive connections
[]: 2019-03-12 13:02:17.126 [reactor-http-nio-3] DEBUG r.n.h.c.HttpClientConnect [id: 0x73262664, L:/127.0.0.1:63086 - R:localhost/127.0.0.1:9006] Handler is being applied: {uri=https://localhost:9006/myApp, method=GET}
[]: 2019-03-12 13:02:17.126 [reactor-http-nio-3] TRACE r.n.c.ChannelOperationsHandler [id: 0x73262664, L:/127.0.0.1:63086 - R:localhost/127.0.0.1:9006] End of the pipeline, User event reactor.netty.NettyPipeline$SendOptionsChangeEvent@524ca33b
[]: 2019-03-12 13:02:17.126 [reactor-http-nio-3] DEBUG r.n.c.ChannelOperationsHandler [id: 0x73262664, L:/127.0.0.1:63086 - R:localhost/127.0.0.1:9006] New sending options
[]: 2019-03-12 13:02:17.126 [reactor-http-nio-3] DEBUG r.n.c.ChannelOperationsHandler [id: 0x73262664, L:/127.0.0.1:63086 - R:localhost/127.0.0.1:9006] Writing object DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
GET /myApp HTTP/1.1
Cookie: JSESSIONID=177C20DD24AAFCE474393F687A7CC676
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Forwarded: proto=https;host="localhost:8443";for="0:0:0:0:0:0:0:1:63098"
X-Forwarded-For: 0:0:0:0:0:0:0:1
X-Forwarded-Proto: https
X-Forwarded-Port: 8443
X-Forwarded-Host: localhost:8443
host: localhost:9006
[]: 2019-03-12 13:02:17.128 [reactor-http-nio-4] DEBUG r.n.c.FluxReceive [id: 0x0972a2f5, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63098] Subscribing inbound receiver [pending: 0, cancelled:false, inboundDone: true]
[]: 2019-03-12 13:02:17.129 [reactor-http-nio-3] DEBUG r.n.c.ChannelOperationsHandler [id: 0x73262664, L:/127.0.0.1:63086 - R:localhost/127.0.0.1:9006] Writing object MonoJust
[]: 2019-03-12 13:04:14.441 [reactor-http-nio-6] DEBUG r.n.t.SslProvider [id: 0x7423cb4d, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63110] SSL enabled using engine SSLEngineImpl
[]: 2019-03-12 13:04:14.441 [reactor-http-nio-7] DEBUG r.n.t.SslProvider [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] SSL enabled using engine SSLEngineImpl
[]: 2019-03-12 13:04:14.442 [reactor-http-nio-6] DEBUG r.n.h.s.HttpServerOperations [id: 0x7423cb4d, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63110] New http connection, requesting read
[]: 2019-03-12 13:04:14.442 [reactor-http-nio-7] DEBUG r.n.h.s.HttpServerOperations [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] New http connection, requesting read
[]: 2019-03-12 13:04:14.442 [reactor-http-nio-7] DEBUG r.n.c.BootstrapHandlers [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Initialized pipeline DefaultChannelPipeline{(reactor.left.sslHandler = io.netty.handler.ssl.SslHandler), (reactor.left.sslReader = reactor.netty.tcp.SslProvider$SslReadHandler), (BootstrapHandlers$BootstrapInitializerHandler#0 = reactor.netty.channel.BootstrapHandlers$BootstrapInitializerHandler), (reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.accessLogHandler = reactor.netty.http.server.AccessLogHandler), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
[]: 2019-03-12 13:04:14.442 [reactor-http-nio-6] DEBUG r.n.c.BootstrapHandlers [id: 0x7423cb4d, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63110] Initialized pipeline DefaultChannelPipeline{(reactor.left.sslHandler = io.netty.handler.ssl.SslHandler), (reactor.left.sslReader = reactor.netty.tcp.SslProvider$SslReadHandler), (BootstrapHandlers$BootstrapInitializerHandler#0 = reactor.netty.channel.BootstrapHandlers$BootstrapInitializerHandler), (reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.accessLogHandler = reactor.netty.http.server.AccessLogHandler), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
[]: 2019-03-12 13:04:14.444 [reactor-http-nio-5] TRACE r.n.c.ChannelOperationsHandler [id: 0xedd15d59, L:/0:0:0:0:0:0:0:1:8443 ! R:/0:0:0:0:0:0:0:1:63099] End of the pipeline, User event SslCloseCompletionEvent(java.nio.channels.ClosedChannelException)
[]: 2019-03-12 13:04:14.454 [reactor-http-nio-7] TRACE r.n.c.ChannelOperationsHandler [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] End of the pipeline, User event SslHandshakeCompletionEvent(SUCCESS)
[]: 2019-03-12 13:04:14.454 [reactor-http-nio-6] TRACE r.n.c.ChannelOperationsHandler [id: 0x7423cb4d, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63110] End of the pipeline, User event SslHandshakeCompletionEvent(SUCCESS)
[]: 2019-03-12 13:04:14.455 [reactor-http-nio-7] DEBUG r.n.h.s.HttpServerOperations [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Increasing pending responses, now 1
[]: 2019-03-12 13:04:14.455 [reactor-http-nio-7] DEBUG r.n.h.s.HttpServer [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@e5aca0f
[]: 2019-03-12 13:04:14.458 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589] Created new pooled channel, now 1 active connections and 1 inactive connections
[]: 2019-03-12 13:04:14.459 [reactor-http-nio-7] DEBUG r.n.t.SslProvider [id: 0xf3aab589] SSL enabled using engine SSLEngineImpl and SNI localhost:9006
[]: 2019-03-12 13:04:14.459 [reactor-http-nio-7] DEBUG r.n.c.BootstrapHandlers [id: 0xf3aab589] Initialized pipeline DefaultChannelPipeline{(reactor.left.sslHandler = io.netty.handler.ssl.SslHandler), (reactor.left.sslReader = reactor.netty.tcp.SslProvider$SslReadHandler), (BootstrapHandlers$BootstrapInitializerHandler#0 = reactor.netty.channel.BootstrapHandlers$BootstrapInitializerHandler), (SimpleChannelPool$1#0 = io.netty.channel.pool.SimpleChannelPool$1), (reactor.left.httpCodec = io.netty.handler.codec.http.HttpClientCodec), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
[]: 2019-03-12 13:04:14.460 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Registering pool release on close event for channel
[]: 2019-03-12 13:04:14.461 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Channel connected, now 2 active connections and 0 inactive connections
[]: 2019-03-12 13:04:14.465 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] onStateChange(PooledConnection{channel=[id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006]}, [connected])
[]: 2019-03-12 13:04:14.465 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] onStateChange(GET{uri=/, connection=PooledConnection{channel=[id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006]}}, [configured])
[]: 2019-03-12 13:04:14.465 [reactor-http-nio-7] DEBUG r.n.h.c.HttpClientConnect [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Handler is being applied: {uri=https://localhost:9006/myApp, method=GET}
[]: 2019-03-12 13:04:14.465 [reactor-http-nio-7] TRACE r.n.c.ChannelOperationsHandler [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] End of the pipeline, User event reactor.netty.NettyPipeline$SendOptionsChangeEvent@1c893d98
[]: 2019-03-12 13:04:14.465 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperationsHandler [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] New sending options
[]: 2019-03-12 13:04:14.465 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperationsHandler [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Writing object DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
GET /myApp HTTP/1.1
Cookie: JSESSIONID=177C20DD24AAFCE474393F687A7CC676
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Forwarded: proto=https;host="localhost:8443";for="0:0:0:0:0:0:0:1:63111"
X-Forwarded-For: 0:0:0:0:0:0:0:1
X-Forwarded-Proto: https
X-Forwarded-Port: 8443
X-Forwarded-Host: localhost:8443
host: localhost:9006
[]: 2019-03-12 13:04:14.466 [reactor-http-nio-7] DEBUG r.n.c.FluxReceive [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Subscribing inbound receiver [pending: 0, cancelled:false, inboundDone: true]
[]: 2019-03-12 13:04:14.466 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperationsHandler [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Writing object MonoJust
[]: 2019-03-12 13:04:14.466 [reactor-http-nio-7] TRACE r.n.c.ChannelOperationsHandler [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] End of the pipeline, User event SslHandshakeCompletionEvent(SUCCESS)
[]: 2019-03-12 13:04:14.468 [reactor-http-nio-7] DEBUG r.n.h.c.HttpClientOperations [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Received response (auto-read:false) : [Location=https://localhost:9006/myApp/, Transfer-Encoding=chunked, Date=Tue, 12 Mar 2019 17:04:14 GMT]
[]: 2019-03-12 13:04:14.468 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] onStateChange(GET{uri=/myApp, connection=PooledConnection{channel=[id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006]}}, [response_received])
[]: 2019-03-12 13:04:14.469 [reactor-http-nio-7] DEBUG r.n.c.FluxReceive [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Subscribing inbound receiver [pending: 0, cancelled:false, inboundDone: false]
[]: 2019-03-12 13:04:14.469 [reactor-http-nio-7] DEBUG r.n.h.c.HttpClientOperations [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Received last HTTP packet
[]: 2019-03-12 13:04:14.469 [reactor-http-nio-7] TRACE r.n.c.ChannelOperations [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] Disposing ChannelOperation from a channel
java.lang.Exception: ChannelOperation terminal stack
    at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:363)
    ...stack trace too big for body of SO question...
    at java.lang.Thread.run(Thread.java:748)
[]: 2019-03-12 13:04:14.470 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] onStateChange(GET{uri=/myApp, connection=PooledConnection{channel=[id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006]}}, [disconnecting])
[]: 2019-03-12 13:04:14.470 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperations [id: 0xf3aab589, L:/127.0.0.1:63113 - R:localhost/127.0.0.1:9006] An outbound error could not be processed
javax.net.ssl.SSLException: SSLEngine closed already
    at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source)
[]: 2019-03-12 13:04:14.472 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 ! R:localhost/127.0.0.1:9006] Channel cleaned, now 1 active connections and 1 inactive connections
[]: 2019-03-12 13:04:14.472 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperationsHandler [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Writing object DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 302 Found
transfer-encoding: chunked
Location: https://localhost:9006/myApp/
Date: Tue, 12 Mar 2019 17:04:14 GMT
[]: 2019-03-12 13:04:14.473 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperationsHandler [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Writing object 
[]: 2019-03-12 13:04:14.473 [reactor-http-nio-7] DEBUG r.n.h.s.HttpServerOperations [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Last HTTP response frame
[]: 2019-03-12 13:04:14.473 [reactor-http-nio-7] DEBUG r.n.c.ChannelOperationsHandler [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Writing object EmptyLastHttpContent
[]: 2019-03-12 13:04:14.473 [reactor-http-nio-7] DEBUG r.n.h.s.HttpServerOperations [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Decreasing pending responses, now 0
[]: 2019-03-12 13:04:14.474 [reactor-http-nio-7] INFO  r.n.h.s.AccessLog 0:0:0:0:0:0:0:1 - - [12/Mar/2019:13:04:14 -0400] "GET /myApp HTTP/1.1" 302 0 8443 19 ms
[]: 2019-03-12 13:04:14.474 [reactor-http-nio-7] TRACE r.n.c.ChannelOperations [id: 0xb46bbc27, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63111] Disposing ChannelOperation from a channel
java.lang.Exception: ChannelOperation terminal stack
    at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:363)
    ...unnecessarily large stack trace...
    at java.lang.Thread.run(Thread.java:748)
[]: 2019-03-12 13:04:14.475 [reactor-http-nio-7] TRACE r.n.c.ChannelOperationsHandler [id: 0xf3aab589, L:/127.0.0.1:63113 ! R:localhost/127.0.0.1:9006] End of the pipeline, User event SslCloseCompletionEvent(java.nio.channels.ClosedChannelException)
[]: 2019-03-12 13:04:14.475 [reactor-http-nio-7] DEBUG r.n.r.PooledConnectionProvider [id: 0xf3aab589, L:/127.0.0.1:63113 ! R:localhost/127.0.0.1:9006] onStateChange(PooledConnection{channel=[id: 0xf3aab589, L:/127.0.0.1:63113 ! R:localhost/127.0.0.1:9006]}, [disconnecting])
[]: 2019-03-12 13:04:15.419 [reactor-http-nio-2] TRACE r.n.c.ChannelOperationsHandler [id: 0xefc0c828, L:/127.0.0.1:8443 ! R:/127.0.0.1:63084] End of the pipeline, User event SslCloseCompletionEvent(java.nio.channels.ClosedChannelException)

有什么想法,为什么它会卡在第一个请求的响应上,而随后的请求却起作用?

也就是说,任何具有重定向的POST请求都会被卡在重定向上的同一位置:

POST /myApp/someController/postTest HTTP/1.1

原木

HTTP/1.1 302 Found
Location: https://localhost:8443/myApp/someController/list
GET /myApp/someController/list HTTP/1.1
Referer: https://localhost:8443/myApp/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Cookie: JSESSIONID=9001F540677D8A043812E88E9F375E58
Accept-Language: en-US,en;q=0.9
Cache-Control: max-age=0
Forwarded: proto=https;host="localhost:8443";for="0:0:0:0:0:0:0:1:63511"
X-Forwarded-For: 0:0:0:0:0:0:0:1
X-Forwarded-Proto: https
X-Forwarded-Port: 8443
X-Forwarded-Host: localhost:8443
host: localhost:9006
[]: 2019-03-12 13:28:28.127 [reactor-http-nio-2] DEBUG r.n.c.FluxReceive [id: 0x77f250af, L:/0:0:0:0:0:0:0:1:8443 - R:/0:0:0:0:0:0:0:1:63511] Subscribing inbound receiver [pending: 0, cancelled:false, inboundDone: false]
[]: 2019-03-12 13:28:28.127 [reactor-http-nio-2] DEBUG r.n.c.ChannelOperationsHandler [id: 0x1ec92a13, L:/127.0.0.1:63513 - R:localhost/127.0.0.1:9006] Writing object MonoJust

而且,日志记录仅仅停止在那里,调用方从来没有收到响应。

共有1个答案

夏侯朝斑
2023-03-14

好吧,好吧,我应该先做的,我最终做了,并将spring-boot版本从2.1.0升级到2.1.3(最新),这就解决了这个问题。

 类似资料:
  • 我打下面的url使用任何Rest客户端,我得到api响应:400坏请求与响应体 输入参数 但是java simple client没有显示响应主体。。下面是java代码。。它只给出了400个坏请求。

  • 我创建了多个微服务与springboo1.4。上周,我决定实现oAuth2授权服务。我的计划是, > 因此,eureka将调用新的授权服务以获取访问令牌。 我发现的问题是,我可以直接从另一个端口(8081)中运行的授权服务器获取JWT访问令牌。当我试图通过zuul网关获取jwt令牌时,不幸的是,我得到了一个空字符串。 请看一下我的网关配置 application.yml(zuul网关) zuul的

  • 我正在开发一个应用程序,它可以与服务器对话,并且有一个登录屏幕。我使用httpconnection与服务器通信(服务器返回Json响应)。我的登录屏幕发送电子邮件和密码,这是由服务器验证的——服务器发送cookie,并期望cookie与每个进一步的请求一起知道用户已登录。 我使用Cookiemanager和cookie处理程序来启用会话,这样用户只需登录一次。 在我的主活动中使用以下2个命令(在创

  • 我试图在安装服务网格、网关和应用路由策略后,在我的Istio入口网关上启用HTTPS。最初的Istio安装是使用一个配置文件完成的,该配置文件包括一个istio-ingress网关服务。当我这样做时,它将入口网关创建为,而不是。 我看了这个:https://istio.io/latest/docs/tasks/traffic-management/ingress/secure-ingress/但是

  • 本文向大家介绍SpringCloud网关Gateway架构解析,包括了SpringCloud网关Gateway架构解析的使用技巧和注意事项,需要的朋友参考一下 网关是介于客户端和服务器端之间的中间层,所有的外部请求都会先经过 网关这一层。也就是说,API 的实现方面更多的考虑业务逻辑,而安全、性能、监控可以交由 网关来做,这样既提高业务灵活性又不缺安全性,典型的架构图如图所示: 安全 ,只有网关系

  • 我正在使用django-python和javascript开发一个项目。当我从视图调用长时间运行的流程(耗时)大约超过20分钟时,流程将成功启动。我在ajax中使用loader通知用户进程正在运行。进程完成后,加载程序将停止并更改为完成状态。 但问题是,每次进程启动14.59分钟后,装载机都会停止并将状态更改为“已完成”。但在后台运行的进程尚未完成。页面在此时间之后崩溃。过程完成后,我将结果绑定到