title: SocketException on local server
body: <p>There is something wrong with my local setup. The project uses a GUI written in Java, that connects to the backend part via Http tunneling. The server is Wildfly 19 and it starts correctly.
  Every setup seems correct, every necessary file is in its place, yet I'm getting &quot;Socket is closed&quot; exception when calling the Http tunneling class. The code does not close the socket erroneously, and it works for everyone else, so there must be a misconfiguration on my local computer.</p>
  <p>Here is the log from the GUI:</p>
  <pre><code>javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.172 CEST|Logger.java:765|WRITE: TLS12 handshake, length = 250
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.301 CEST|Logger.java:765|READ: TLSv1.2 handshake, length = 4644
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.302 CEST|Logger.java:765|READ: TLSv1.2 handshake, length = 4644
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.324 CEST|Logger.java:765|WRITE: TLS12 handshake, length = 70
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.340 CEST|Logger.java:765|WRITE: TLS12 handshake, length = 24
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.393 CEST|Logger.java:765|READ: TLSv1.2 change_cipher_spec, length = 1
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.393 CEST|Logger.java:765|READ: TLSv1.2 change_cipher_spec, length = 1
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.394 CEST|Logger.java:765|READ: TLSv1.2 handshake, length = 40
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.395 CEST|Logger.java:765|READ: TLSv1.2 handshake, length = 40
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.415 CEST|Logger.java:765|WRITE: TLS12 application_data, length = 231
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.492 CEST|Logger.java:765|READ: TLSv1.2 application_data, length = 159
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.493 CEST|Logger.java:765|READ: TLSv1.2 application_data, length = 159
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.500 CEST|Logger.java:765|READ: TLSv1.2 application_data, length = 29
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.500 CEST|Logger.java:765|READ: TLSv1.2 application_data, length = 29
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.503 CEST|Logger.java:765|duplex close of SSLSocket
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.505 CEST|Logger.java:765|WRITE: TLS12 alert(close_notify), length = 10
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.506 CEST|Logger.java:765|close the underlying socket
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.506 CEST|Logger.java:765|close the SSL connection (initiative)
  javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.507 CEST|Logger.java:765|close inbound of SSLSocket
  javax.net.ssl|WARNING|01|main|2020-10-13 13:50:20.509 CEST|Logger.java:765|SSLSocket duplex close failed (
  &quot;throwable&quot; : {
    java.net.SocketException: Socket is closed
      at java.net.Socket.shutdownInput(Socket.java:1539)
      at sun.security.ssl.BaseSSLSocketImpl.shutdownInput(BaseSSLSocketImpl.java:216)
      at sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:661)
      at sun.security.ssl.SSLSocketImpl.bruteForceCloseInput(SSLSocketImpl.java:609)
      at sun.security.ssl.SSLSocketImpl.duplexCloseOutput(SSLSocketImpl.java:569)
      at sun.security.ssl.SSLSocketImpl.close(SSLSocketImpl.java:482)
      at sun.net.www.http.HttpClient.closeServer(HttpClient.java:1057)
      at sun.net.www.protocol.https.HttpsClient.closeIdleConnection(HttpsClient.java:669)
      at sun.net.www.protocol.http.HttpURLConnection.disconnect(HttpURLConnection.java:2951)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.disconnect(HttpsURLConnectionImpl.java:279)
      at com.mycompany.myteam.remoting.RemotingClientHTTPS.callUserAuthSupportServlet(RemotingClientHTTPS.java:368)
      at com.mycompany.myteam.remoting.RemotingClientHTTPS.connect(RemotingClientHTTPS.java:188)
      at com.mycompany.myteam.ui.platform.dialogs.LoginDialog.okPressed(LoginDialog.java:146)
      at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:466)
      at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
      at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
      at org.eclipse.jface.window.Window.open(Window.java:803)
  </code></pre>
  <p>This appears in the beginning when I start the GUI. However, it connects to the database and performs queries successfully. Write operations give me various errors that are probably all caused by the socket being closed.</p>
  <p>I have no idea what closes the socket and why. It certainly isn't in the code because it works for others.</p>
  <p>Is it worth to give it a try to analyse it with Wireshark? Any other ideas?</p>
  <p>Thanks in advance.</p>
  <p>EDIT:
  here is the relevant part of the code, however, this is not caused by the code:</p>
  <pre><code>@Override
      public synchronized void connect(final String user, final String pwd) throws LoginFailedException {
          if (holder != null) {
              log.error(&quot;Client is already initialised&quot;);
          } else {
              try {
                  namingHelper = new NamingHelper(properties);
  
                  log.debug(&quot;Initialise remote client for user &quot; + user);
  
                  // register Authenticator for this session
                  UserAuthenticator userAuthenticator = new UserAuthenticator (pwd);
                  Authenticator.setDefaultuserAuthenticator 
  
                  StubHolder stubs = new StubHolder();
  
                  fillHolder(stubs);
  
                  String[] authAttrs = callUserAuthSupportServlet(user, false).split(&quot;\n&quot;);
                  log.debug(&quot;Authentication attributes: &quot; + Arrays.toString(authAttrs));
  
                  RemotingClient.setAuthenticationAttribute(authAttrs[0]);
  
                  if ( authAttrs.length &gt; 1 &amp;&amp; authAttrs[1].equals(&quot;(mail={0})&quot;) &amp;&amp; authAttrs[2].equals(&quot;mail&quot;)){
                      userAuthenticator.setCheckMaxLogins(true);
                      checkUserValidityByEmail(stubs, user);
                  }
                  else{
                      userAuthenticator.setCheckMaxLogins(false);
                      checkUserValidity(stubs, RemotingClient.getAuthenticationAttribute());
                  }
  
                  holder = stubs;
  
                  log.debug(&quot;Completed, clientInfo: &quot; + stubs.clientInfo);
              } catch (LoginFailedException e) {
                  throw e;
              } catch (Exception e) {
                  if ( (e.getCause() != null &amp;&amp; e.getCause() instanceof BogusCredentialMarkerException) || e instanceof BogusCredentialMarkerException ){
                      throw new LoginFailedException();
                  }
                  throw new TechnicalException(e.getMessage(), e);
              }
          }
      }
  </code></pre>