Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1048761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:30:33+00:00 2026-05-16T16:30:33+00:00

Using Apache FTPSClient to listFiles(String)…. The aplication crashes sometimes after resuming an SSL Session

  • 0

Using Apache FTPSClient to listFiles(String)….

The aplication crashes sometimes after resuming an SSL Session and then calling sslSocketImpl.startHandshake() from the Apache FTPSClient code.

I set javax.net.debug to print the ssl information…
System.setProperty(“javax.net.debug”, “all”);

And this is what I get.

%% Client cached [Session-3, SSL_RSA_WITH_3DES_EDE_CBC_SHA]
%% Try resuming [Session-3, SSL_RSA_WITH_3DES_EDE_CBC_SHA] from port 4149
*** ClientHello, TLSv1
....
main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
main, SEND TLSv1 ALERT:  fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 01 00 02 02 28                               ......(
main, called closeSocket()
[Mon Aug 30 17:41:52 PDT 2010][class com.smgtec.sff.fileupload.poller.BasicFTPAccess] - Could not list directory: sqjavax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
 at com.smgtec.sff.fileupload.poller.FixedFTPSClient._openDataConnection_(FixedFTPSClient.java:525)
 at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2296)
 at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)

Padded plaintext before ENCRYPTION:  len = 32
0000: 50 41  at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
 at com.smgtec.sff.fileupload.poller.BasicFTPAccess.listFiles(BasicFTPAccess.java:100)
 at com.smgtec.sff.fileupload.poller.FTPPoller.addFileForProcessing(FTPPoller.java:67)
 at com.smgtec.sff.fileupload.poller.FTPPoller.main(FTPPoller.java:385)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
 at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
 ... 10 more

We also have jscape FTPS client here and it produces the same problem.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:30:33+00:00Added an answer on May 16, 2026 at 4:30 pm

    I solved it like this using SSLSession.invalidate() it seems to work now… although we aren’t using FTPS anymore. If this is a true solution there is a problem in Apache commons-net FTPSClient or the FTP Server we are connecting to.

    ftp = new FTPSClient() 
          {
            private Socket socket;
    
            protected Socket _openDataConnection_(int command, String arg) throws IOException
            {
              if (socket != null && socket instanceof SSLSocket)
              {
                // We have problems resuming cached SSL Sessions. Exceptions are
                // thrown and the system crashes... So we invalidate each SSL
                // session we used last.
                SSLSocket sslSocket = (SSLSocket) socket;
                sslSocket.getSession().invalidate();
              }
              socket = super._openDataConnection_(command, arg);
              return socket;
            }
          };
    

    BTW I believe we were connecting to a FileZilla FTP server. I suspect this fix will cause more network chatter passing back and forth keys/certs and so forth.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Apache POI for writing content into excel sheet. after generating an
I'm trying to connect to a FTP using Apaches FTPSClient but I keep getting
Using Apache Commons VFS , how do I monitor the progress of a file
Using Apache POI to generate a document and i'm having a small problem with
Using Apache 2.2 and PHP 5, what's the best way to run PHP without
Using Apache Wicket 1.4: I have a panel that calls some setup Javascript in
I am using Apache Hadoop (hadoop-0.20.203.0) and unable to set sticky bit for /tmp
I'm using Apache Commons FTP to upload a file. Before uploading I want to
I am using apache tomcat as a web server. I have deployed webservices on
I am using Apache POI 3.8 libraries to read an XLSX file in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.