0
votes

After I made the my spring boot reactive web application to support SSL, when I try to make a http call to the server, it prints below exception trace in console. As an application owner I cannot prevent any one hitting my service. But I should be able to prevent that trace printing in console, especially in a reactive web app, where an IO operation is costly . Any idea to prevent this ?

Edit 3 :

2018-10-01 14:11:18.440 ERROR 12457 --- [ctor-http-nio-2] r.i.n.channel.CloseableContextHandler    : Handler failure while no child channelOperation was present

Edit 2:

where an IO operation is costly I just realized that this might be happening outside event loop thread pool. So it may not block any threads. But I still like to prevent that from printing in console.

Edit 1 :

Steps to reproduce

  • Checkout the project https://github.com/sp13ceg/spring-boot-reative-ssl
  • start the server ./gradlew booRun
  • Make a insecure https call curl --insecure https://localhost:8080/hi works without error
  • Make a http call curl http://localhost:8080/hi you will see the exception in console.

    io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 474554202f686920485454502f312e310d0a486f73743a206c6f63616c686f73743a383434340d0a557365722d4167656e743a206375726c2f372e35342e300d0a4163636570743a202a2f2a0d0a0d0a at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1178) [netty-handler-4.1.29.Final.jar:4.1.29.Final] at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243) [netty-handler-4.1.29.Final.jar:4.1.29.Final] at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489) [netty-codec-4.1.29.Final.jar:4.1.29.Final] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428) [netty-codec-4.1.29.Final.jar:4.1.29.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) [netty-codec-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-transport-4.1.29.Final.jar:4.1.29.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [netty-common-4.1.29.Final.jar:4.1.29.Final] at java.lang.Thread.run(Thread.java:748)

1
can you share configuration file for your app ? - Thanh Nguyen Van
server.port=8444 server.ssl.enabled=true server.ssl.key-store=serverCerts/server.jks server.ssl.key-store-password=password server.ssl.client-auth=WANT server.ssl.trust-store=serverCerts/ca.jks server.ssl.trust-store-password=password - shanmugaprabhu
Can you edit your question to add that information? How are you triggering this exception message? - Brian Clozel
I have edited the question with a link to sample project. - shanmugaprabhu

1 Answers

0
votes

I just missed an important thing in log trace. There was a line before the original stack trace which shows the name of the log from where it is coming. see Edit 3.

Adding this property disables this log getting printed in console. logging.level.reactor.ipc.netty.channel.CloseableContextHandler=off