title: Caught an exception, leaving main loop due to Socket closed
body: <p>Not able to send the files to SFTP server. I didn't find the exact issue from the logs see below. used <strong>Spring integration SFTP configuration</strong> to send my files to client instance. I have referred this link <a href="https://blog.pavelsklenar.com/spring-integration-sftp-upload-example/" rel="noreferrer">https://blog.pavelsklenar.com/spring-integration-sftp-upload-example/</a> for implementation. what i m doing wrong here. Any help would be appreciated thank you.</p>
  
  <p>below is the code snippet</p>
  
  <pre><code>DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(true);
          factory.setHost(sftpHost);
          factory.setPort(sftpPort);
          factory.setUser(sftpUser);
          factory.setPassword(sftpPasword);
          factory.setAllowUnknownKeys(true);
  </code></pre>
  
  <p>see the logs below</p>
  
  <pre><code>    10-12-2018 03:03:22.261 [task-scheduler-1] INFO  org.springframework.integration.sftp.session.DefaultSftpSessionFactory.promptYesNo - The authenticity of host 'example.com' can't be established.
  RSA key fingerprint is d1:e9:4e:64:a8:e5:19:46:7a:0e:79:2d:bf:27:cb:4c.
  Are you sure you want to continue connecting?
  10-12-2018 03:03:22.264 [task-scheduler-1] DEBUG org.springframework.integration.sftp.session.DefaultSftpSessionFactory.promptYesNo - No UserInfo provided - The authenticity of host 'example.com' can't be established.
  RSA key fingerprint is d1:e9:4e:64:a8:e5:19:46:7a:0e:79:2d:bf:27:cb:4c.
  Are you sure you want to continue connecting?, returning:true
  10-12-2018 03:03:22.265 [task-scheduler-1] WARN  com.jcraft.jsch.log - Permanently added 'example.com' (RSA) to the list of known hosts.
  10-12-2018 03:03:22.269 [task-scheduler-1] INFO  com.jcraft.jsch.log - SSH_MSG_NEWKEYS sent
  10-12-2018 03:03:22.270 [task-scheduler-1] INFO  com.jcraft.jsch.log - SSH_MSG_NEWKEYS received
  10-12-2018 03:03:22.280 [task-scheduler-1] INFO  com.jcraft.jsch.log - SSH_MSG_SERVICE_REQUEST sent
  10-12-2018 03:03:22.306 [task-scheduler-1] INFO  com.jcraft.jsch.log - SSH_MSG_SERVICE_ACCEPT received
  10-12-2018 03:03:22.308 [task-scheduler-1] DEBUG org.springframework.integration.sftp.session.DefaultSftpSessionFactory.showMessage - SSH Server supporting SFTP and SCP
  
  10-12-2018 03:03:22.337 [task-scheduler-1] INFO  com.jcraft.jsch.log - Authentications that can continue: publickey,keyboard-interactive,password
  10-12-2018 03:03:22.338 [task-scheduler-1] INFO  com.jcraft.jsch.log - Next authentication method: publickey
  10-12-2018 03:03:22.342 [task-scheduler-1] INFO  com.jcraft.jsch.log - Authentications that can continue: keyboard-interactive,password
  10-12-2018 03:03:22.349 [task-scheduler-1] INFO  com.jcraft.jsch.log - Next authentication method: keyboard-interactive
  10-12-2018 03:03:22.425 [task-scheduler-1] INFO  com.jcraft.jsch.log - Authentication succeeded (keyboard-interactive).
  10-12-2018 03:03:22.859 [task-scheduler-1] DEBUG org.springframework.integration.sftp.session.SftpSession.rename - File: CONVERGE_20181013.zip.writing was successfully renamed to CONVERGE_20181013.zip
  10-12-2018 03:03:22.861 [task-scheduler-1] INFO  com.jcraft.jsch.log - Disconnecting from example.com port 22
  10-12-2018 03:03:22.866 [Connect thread example.com session] INFO  com.jcraft.jsch.log - Caught an exception, leaving main loop due to Socket closed
  </code></pre>