Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272340

TLS close_notify handling issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 17
    • Fix Version/s: 19
    • Component/s: security-libs
    • Labels:
      None

      Description

      During testing with JDK 17 and JGDMS, TLS closure handing is causing some issues:

      Sample exception trace from logs

      ```
           [java] ActSys-err: javax.net.ssl|DEBUG|D2|(JSK) mux reader|2021-08-11 14:56:20.606 AEST|SSLSocketImpl.java:1775|close the SSL connection (passive)
           [java] ActSys-err: javax.net.ssl|DEBUG|C2|(JSK) mux writer|2021-08-11 14:56:20.606 AEST|SSLSocketImpl.java:572|duplex close of SSLSocket
           [java] ActSys-err: javax.net.ssl|ALL|D2|(JSK) mux reader|2021-08-11 14:56:20.606 AEST|SSLSocketImpl.java:1129|Closing input stream
           [java] ActSys-err: javax.net.ssl|WARNING|B2|(JSK) mux reader|2021-08-11 14:56:20.607 AEST|SSLSocketImpl.java:1666|handling exception (
           [java] ActSys-err: "throwable" : {
           [java] ActSys-err: java.net.SocketException: Socket closed
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl.endRead(NioSocketImpl.java:248)
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:327)
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)
           [java] ActSys-err: at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1455)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1059)
           [java] ActSys-err: at org.apache.river.jeri.internal.mux.StreamConnectionIO$1.read(StreamConnectionIO.java:372)
           [java] ActSys-err: at org.apache.river.jeri.internal.mux.StreamConnectionIO$Reader.run(StreamConnectionIO.java:277)
           [java] ActSys-err: at org.apache.river.thread.ThreadPool$Task.run(ThreadPool.java:172)
           [java] ActSys-err: at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
           [java] ActSys-err: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
           [java] ActSys-err: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
           [java] ActSys-err: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
           [java] ActSys-err: at java.base/java.lang.Thread.run(Thread.java:833)}
           [java] ActSys-err:
           [java] ActSys-err: )
           [java] ActSys-err: javax.net.ssl|ERROR|B2|(JSK) mux reader|2021-08-11 14:56:20.607 AEST|TransportContext.java:363|Fatal (UNEXPECTED_MESSAGE): Socket closed (
           [java] ActSys-err: "throwable" : {
           [java] ActSys-err: java.net.SocketException: Socket closed
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl.endRead(NioSocketImpl.java:248)
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:327)
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)
           [java] ActSys-err: at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)
           [java] ActSys-err: at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1455)
           [java] ActSys-err: at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1059)
           [java] ActSys-err: at org.apache.river.jeri.internal.mux.StreamConnectionIO$1.read(StreamConnectionIO.java:372)
           [java] ActSys-err: at org.apache.river.jeri.internal.mux.StreamConnectionIO$Reader.run(StreamConnectionIO.java:277)
           [java] ActSys-err: at org.apache.river.thread.ThreadPool$Task.run(ThreadPool.java:172)
           [java] ActSys-err: at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
           [java] ActSys-err: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
           [java] ActSys-err: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
           [java] ActSys-err: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
           [java] ActSys-err: at java.base/java.lang.Thread.run(Thread.java:833)}
           [java] ActSys-err:
           [java] ActSys-err: )
      ```

      See comments section for location of test logs.

      This does not appear to happen on JDK 16, only 17 has shown this issue thus far.

        Attachments

          Activity

            People

            Assignee:
            jnimeh Jamil Nimeh
            Reporter:
            jnimeh Jamil Nimeh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: