title: SSLSocket duplex close failed java.net.SocketException: Socket is closed while trying to connect to DB2 over TLS
body: <p>I'm trying to understand why this error occurs:</p>
  <pre><code>javax.net.ssl|WARNING|01|main|2021-07-04 12:08:30.668 CEST|SSLSocketImpl.java:497|SSLSocket duplex close failed (
  &quot;throwable&quot; : {
    java.net.SocketException: Socket is closed
          at java.base/java.net.Socket.shutdownInput(Socket.java:1538)
          at java.base/sun.security.ssl.BaseSSLSocketImpl.shutdownInput(BaseSSLSocketImpl.java:216)
          at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:751)
          at java.base/sun.security.ssl.SSLSocketImpl.bruteForceCloseInput(SSLSocketImpl.java:701)
          at java.base/sun.security.ssl.SSLSocketImpl.duplexCloseOutput(SSLSocketImpl.java:562)
          at java.base/sun.security.ssl.SSLSocketImpl.close(SSLSocketImpl.java:486)
          at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.close(SSLSocketImpl.java:1034)
          at com.ibm.db2.jcc.t4.a0.j(a0.java:343)
          at com.ibm.db2.jcc.t4.b.freeTransport_(b.java:5523)
          at com.ibm.db2.jcc.t4.a.close_(a.java:455)
          at com.ibm.db2.jcc.am.Agent.close(Agent.java:345)
          at com.ibm.db2.jcc.t4.b.b(b.java:965)
          at com.ibm.db2.jcc.t4.b.a(b.java:804)
          at com.ibm.db2.jcc.t4.b.a(b.java:441)
          at com.ibm.db2.jcc.t4.b.a(b.java:414)
          at com.ibm.db2.jcc.t4.b.&lt;init&gt;(b.java:352)
          at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:233)
          at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:200)
          at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:182)
          at com.example.MainApplication.main(MainApplication.java:36)}
  
  )
  javax.net.ssl|ALL|01|main|2021-07-04 12:08:30.668 CEST|SSLSocketImpl.java:1217|Closing output stream
  Exception in sql: com.ibm.db2.jcc.am.SqlNonTransientConnectionException
  DB2 SQL Error: SQLCODE=-20157, SQLSTATE=08004, SQLERRMC=WEBADMIN;QUIESCE DATABASE;;, DRIVER=4.25.13
  com.ibm.db2.jcc.am.SqlNonTransientConnectionException: DB2 SQL Error: SQLCODE=-20157, SQLSTATE=08004
  </code></pre>
  <p>The exception is thrown when I'm invoking getConnection() method of the DriverManager:</p>
  <pre><code>connection = DriverManager.getConnection(DB_URL, properties);
  </code></pre>
  <p>I'm using Java 11.0.11 from Oracle (non-OpenJDK).</p>