代码之家  ›  专栏  ›  技术社区  ›  Trebla

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

  •  0
  • Trebla  · 技术社区  · 5 年前

    编辑:已解决。在运行一个带有SpringBoot2.1.0的网关,升级到2.1.3,解决了这个问题。


    • 在端口上运行的网关 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
    

    然后就停下来了 Writing object MonoJust . 只有在第一次尝试通过网关访问应用程序时才会发生这种情况。按refresh,请求将完成:

    []: 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
    

    0 回复  |  直到 5 年前
        1
  •  0
  •   Trebla    5 年前

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