Hi! I have tested the same configuration in windows and it worked! As Sai Pullabhotla suggested, the issue was related with the SSL library in Linux, I'll install a different version of the library to get it working.
Thank you very much! ----- Original Message ----- From: "Rubén Páez" <ruben.p...@itac.com.co> To: "Sai Pullabhotla" <sai.pullabho...@jmethods.com> Cc: "Rubén Páez" <rdp...@gmail.com>, ftpserver-users@mina.apache.org Sent: Friday, February 1, 2013 8:57:44 AM Subject: Re: Upload hangs using FTPS Hi! Thank you for your response! I'd been working on other things so I hadn't time to reply, I apologize... I think the hint you are pointing me to is really helpful, I can't test today but I think that it will help me a lot, and I will stop wasting time trying to figure what's going on. I'll post back any findings about the topic as soon as I can test. have a nice day! ----- Original Message ----- From: "Sai Pullabhotla" <sai.pullabho...@jmethods.com> To: "Rubén Páez" <ruben.p...@itac.com.co> Cc: "Rubén Páez" <rdp...@gmail.com>, ftpserver-users@mina.apache.org Sent: Wednesday, January 30, 2013 9:43:09 AM Subject: Re: Upload hangs using FTPS That is strange... not sure what's special about uploads. Looks like it is a Ubuntu/FileZilla/Linux/SSL library issue. I found this post which appears to match with your descriptions. http://forum.filezilla-project.org/viewtopic.php?f=2&t=24746 On the above post some one said the issue was fixed with FileZilla version 3.6.0.2. Hope this helps. On Tue, Jan 29, 2013 at 11:25 AM, Rubén Páez < ruben.p...@itac.com.co > wrote: Hi, thank you for your prompt reply. You can find my answers to your questions below: @David: > Are you sure your description of the problem is correct? Sorry, I think my description was vague, I'll try to elaborate better. > According to you, this error occurs when you cancel the upload . But you > can see that the warn message is written 11 seconds after the STOR command > is received Yes, the SSLException is thrown because I'm cancelling the upload. But I hit cancel because when I upload the file (STOR), the upload stalls, it never finishes, just 300 kB are sent and then the transfer speed goes to 0 kB/s. The exception is not the problem, the problem is why uploads won't work. @Sai > Can you please answer the questions below so we all have a better > understanding of what's going on? > 1. Are downloads working fine for you? Yes, I can perform any other action. Uploads are the only feature I'm missing. > 2. Is directory listing working fine for you? Normally FileZilla does a > LIST or MLSD command to list the directory contents soon after login, but I > do not see anything in the logs to reflect it. Ohh, sorry, I intentionally deleted those lines, but the MLSD is sent: START ---------- ---------- ---------- ---------- ---------- ---------- Status: Resolving address of localhost Status: Connecting to 127.0.0.1:21991... Status: Connection established, initializing TLS... Status: Verifying certificate... Status: TLS/SSL connection established, waiting for welcome message... Response: 220 Service ready for new user. Command: USER admin Response: 331 User name okay, need password for admin. Command: PASS ***** Response: 230 User logged in, proceed. Command: SYST Response: 215 UNIX Type: Apache FtpServer Command: FEAT Response: 211-Extensions supported Response: SIZE Response: MDTM Response: REST STREAM Response: LANG en;zh-tw;ja;is Response: MLST Size;Modify;Type;Perm Response: AUTH SSL Response: AUTH TLS Response: MODE Z Response: UTF8 Response: TVFS Response: MD5 Response: MMD5 Response: MFMT Response: 211 End Command: OPTS UTF8 ON Response: 200 Command OPTS okay. Command: PBSZ 0 Response: 200 Command PBSZ okay. Command: PROT P Response: 200 Command PROT okay. Command: OPTS MLST size;modify;type; Response: 200 Command OPTS okay. Status: Connected Status: Retrieving directory listing... Command: PWD Response: 257 "/" is current directory. Command: TYPE I Response: 200 Command TYPE okay. Command: PASV Response: 227 Entering Passive Mode (127,0,0,1,153,43) Command: MLSD Response: 150 File status okay; about to open data connection. Response: 226 Closing data connection. Status: Directory listing successful END ---------- ---------- ---------- ---------- ---------- ---------- > 3. What happens if you try to upload a small file (like 1K or less) In FileZilla it works. Using FileZilla, I can upload files smaller than 300kb. I can even upload files bigger than 300 kB, but after FileZilla timeouts several times: for example, if I try to upload a file of 1.9 MB it takes almost 60 s to complete, but first it uploads 300 kB, then FileZilla prints connection timeout (and server logs SSLException, because the client closes the connection), FileZilla then retries the operation, this time it can upload a little more, then another timeout and so on, until it finally completes. But with other clients, like WinSCP, I cannot even upload an small file. I also tested a java ftp client library, and I found that when uploading using FTPES without issuing the AUTH SSL command and PROT C I can upload files, as soon as I send the AUTH SSL, FTPES uploads don't work either. > 4. Are the uploads working fine when you are NOT using SSL at all (plain > old FTP)? FTP works perfectly, just as any other action in FTPES or FTPS. just upload fails. > 5. Do you see any errors in FileZilla log or the FTP Server log when you > quit (logout) the session? Just login and log out without doing anything > else. > No errors besides the SSLException, but that exception is thrown only because I cancel the upload after some time or when FileZilla timeouts and try to upload again, when it tries to upload again, generally it can upload more bytes (sometimes it can upload almost 0.5 MB) but again it stalls and never goes beyond that. > > Thanks. again, thanks for all your help. ----- Original Message ----- From: "Sai Pullabhotla" < sai.pullabho...@jmethods.com > To: ftpserver-users@mina.apache.org Cc: rdp...@gmail.com Sent: Tuesday, January 29, 2013 6:00:41 AM Subject: Re: Upload hangs using FTPS Can you please answer the questions below so we all have a better understanding of what's going on? 1. Are downloads working fine for you? 2. Is directory listing working fine for you? Normally FileZilla does a LIST or MLSD command to list the directory contents soon after login, but I do not see anything in the logs to reflect it. 3. What happens if you try to upload a small file (like 1K or less) 4. Are the uploads working fine when you are NOT using SSL at all (plain old FTP)? 5. Do you see any errors in FileZilla log or the FTP Server log when you quit (logout) the session? Just login and log out without doing anything else. Thanks. On Mon, Jan 28, 2013 at 9:21 AM, Rubén Páez < ruben.p...@itac.com.co > wrote: > > > Hi! > > > I have configured an standalone ftp server (Apache FTPServer) using this > config file: > > > > > START ---------- ---------- ---------- ---------- ---------- ---------- > ---------- > > <?xml version="1.0" encoding="UTF-8"?> > <server xmlns=" http://mina.apache.org/ftpserver/spring/v1 " > xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " > xsi:schemaLocation=" > http://mina.apache.org/ftpserver/spring/v1 > http://mina.apache.org/ftpserver/ftpserver-1.0.xsd > " > id="myServer"> > <listeners> > <nio-listener name="default" port="2122"> > <ssl> > <keystore file="./res/ftpserver.jks" password="password" /> > </ssl> > </nio-listener> > <nio-listener name="sdefault" port="21991" implicit-ssl="true"> > <ssl> > <keystore file="./res/ftpserver.jks" password="password" /> > </ssl> > </nio-listener> > </listeners> > <file-user-manager file="./res/conf/users.properties" /> > </server> > END ---------- ---------- ---------- ---------- ---------- ---------- > ---------- > > > > > I use FileZilla Client to log in (either using FTPES or FTPS, I've tried > both, I accept the certificate FileZilla displays to me) and try to upload > a file. Everything seems ok, but the upload always stalls (around 300 kB). > The log of FileZilla Client is: > > > > > START ---------- ---------- ---------- ---------- ---------- ---------- > ---------- > > Status: Resolving address of localhost > Status: Connecting to 127.0.0.1:2122... > Status: Connection established, waiting for welcome message... > Response: 220 Service ready for new user. > Command: AUTH TLS > Response: 234 Command AUTH okay; starting TLS connection. > Status: Initializing TLS... > Status: Verifying certificate... > Command: USER xxx > Status: TLS/SSL connection established. > Response: 331 User name okay, need password for xxx > Command: PASS ***** > Response: 230 User logged in, proceed. > Command: OPTS UTF8 ON > Response: 200 Command OPTS okay. > Command: PBSZ 0 > Response: 200 Command PBSZ okay. > Command: PROT P > Response: 200 Command PROT okay. > Command: OPTS MLST size;modify;type; > Response: 200 Command OPTS okay. > Status: Connected > Status: Starting upload of xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > Command: CWD / > Response: 250 Directory changed to / > Command: PWD > Response: 257 "/" is current directory. > Command: TYPE I > Response: 200 Command TYPE okay. > Command: PASV > Response: 227 Entering Passive Mode (127,0,0,1,199,113) > Command: STOR xxxxxxxxxxxxxxxxxxxxxxx > Response: 150 File status okay; about to open data connection. > Error: Connection timed out > Error: File transfer failed after transferring 278.6 KB in 21 seconds > Response: 551 xxxxxxxxxxxxxxxxxxxxxx: Error on output file. > Status: Disconnected from server > Error: Connection closed by server > END ---------- ---------- ---------- ---------- ---------- ---------- > ---------- > > > > > and the Apache FTP Sever log is: > > > > > START ---------- ---------- ---------- ---------- ---------- ---------- > ---------- > > [ INFO] 2013-01-25 12:04:31,940 [] [] Refreshing > org.springframework.context.support.FileSystemXmlApplicationContext@ed0338: > display name > [org.springframework.context.support.FileSystemXmlApplicationContext@ed0338]; > startup date [Fri Jan 25 12:04:31 COT 2013]; root of context hierarchy > [ INFO] 2013-01-25 12:04:32,030 [] [] Loading XML bean definitions from > file [xxxxxxxxxxxx/apache-ftpserver-1.0.6/res/conf/ftpd-typical.xml] > [ INFO] 2013-01-25 12:04:32,370 [] [] Bean factory for application context > [org.springframework.context.support.FileSystemXmlApplicationContext@ed0338]: > org.springframework.beans.factory.support.DefaultListableBeanFactory@19bb25a > [ INFO] 2013-01-25 12:04:32,402 [] [] Pre-instantiating singletons in > org.springframework.beans.factory.support.DefaultListableBeanFactory@19bb25a: > defining beans > [org.apache.ftpserver.listener.ListenerFactory#0,org.apache.ftpserver.listener.ListenerFactory#1,org.apache.ftpserver.usermanager.PropertiesUserManagerFactory#0,org.apache.ftpserver.FtpServerFactory#0,myServer]; > > root of factory hierarchy > [ INFO] 2013-01-25 12:04:32,744 [] [] FTP server started > > > [ INFO] 2013-01-25 12:05:06,927 [] [127.0.0.1] CREATED > [ INFO] 2013-01-25 12:05:06,929 [] [127.0.0.1] OPENED > [ INFO] 2013-01-25 12:05:06,930 [] [127.0.0.1] SENT: 220 Service ready for > new user. > > > [ INFO] 2013-01-25 12:05:07,051 [] [127.0.0.1] RECEIVED: AUTH TLS > [ INFO] 2013-01-25 12:05:07,163 [] [127.0.0.1] SENT: 234 Command AUTH > okay; starting TLS connection. > > > [ INFO] 2013-01-25 12:05:07,164 [] [127.0.0.1] RECEIVED: USER xxx > [ INFO] 2013-01-25 12:05:07,167 [xxx] [127.0.0.1] SENT: 331 User name > okay, need password for xxx. > > > [ INFO] 2013-01-25 12:05:07,208 [xxx] [127.0.0.1] RECEIVED: PASS ***** > [ INFO] 2013-01-25 12:05:07,209 [xxx] [127.0.0.1] Login success - xxx > [ INFO] 2013-01-25 12:05:07,210 [xxx] [127.0.0.1] SENT: 230 User logged > in, proceed. > > > [ INFO] 2013-01-25 12:05:07,258 [xxx] [127.0.0.1] RECEIVED: OPTS UTF8 ON > [ INFO] 2013-01-25 12:05:07,261 [xxx] [127.0.0.1] SENT: 200 Command OPTS > okay. > > > [ INFO] 2013-01-25 12:05:07,318 [xxx] [127.0.0.1] RECEIVED: PBSZ 0 > [ INFO] 2013-01-25 12:05:07,319 [xxx] [127.0.0.1] SENT: 200 Command PBSZ > okay. > > > [ INFO] 2013-01-25 12:05:07,343 [xxx] [127.0.0.1] RECEIVED: PROT P > [ INFO] 2013-01-25 12:05:07,344 [xxx] [127.0.0.1] SENT: 200 Command PROT > okay. > > > [ INFO] 2013-01-25 12:05:07,384 [xxx] [127.0.0.1] RECEIVED: OPTS MLST > size;modify;type; > [ INFO] 2013-01-25 12:05:07,386 [xxx] [127.0.0.1] SENT: 200 Command OPTS > okay. > > > [ INFO] 2013-01-25 12:05:07,421 [xxx] [127.0.0.1] RECEIVED: CWD / > [ INFO] 2013-01-25 12:05:07,422 [xxx] [127.0.0.1] SENT: 250 Directory > changed to / > > > [ INFO] 2013-01-25 12:05:07,452 [xxx] [127.0.0.1] RECEIVED: PWD > [ INFO] 2013-01-25 12:05:07,454 [xxx] [127.0.0.1] SENT: 257 "/" is current > directory. > > > [ INFO] 2013-01-25 12:05:07,499 [xxx] [127.0.0.1] RECEIVED: TYPE I > [ INFO] 2013-01-25 12:05:07,503 [xxx] [127.0.0.1] SENT: 200 Command TYPE > okay. > > > [ INFO] 2013-01-25 12:05:07,553 [xxx] [127.0.0.1] RECEIVED: PASV > [ INFO] 2013-01-25 12:05:07,556 [xxx] [127.0.0.1] SENT: 227 Entering > Passive Mode (127,0,0,1,199,113) > > > [ INFO] 2013-01-25 12:05:07,599 [xxx] [127.0.0.1] RECEIVED: STOR > xxxxxxxxxxxxxx > [ WARN] 2013-01-25 12:05:28,477 [xxx] [127.0.0.1] Exception during data > transfer, closing data connection socket > javax.net.ssl.SSLException: SSL peer shut down incorrectly > at > com.sun.net.ssl.internal.ssl.InputRecord.readV3Record(InputRecord.java:408) > at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:360) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:820) > > at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) > at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) > at java.io.BufferedInputStream.read(BufferedInputStream.java:317) > at java.io.FilterInputStream.read(FilterInputStream.java:90) > at > org.apache.ftpserver.impl.IODataConnection.transfer(IODataConnection.java:243) > > at > org.apache.ftpserver.impl.IODataConnection.transferFromClient(IODataConnection.java:136) > > at org.apache.ftpserver.command.impl.STOR.execute(STOR.java:146) > at > org.apache.ftpserver.impl.DefaultFtpHandler.messageReceived(DefaultFtpHandler.java:210) > > at > org.apache.ftpserver.listener.nio.FtpHandlerAdapter.messageReceived(FtpHandlerAdapter.java:61) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) > > at > org.apache.ftpserver.listener.nio.FtpLoggingFilter.messageReceived(FtpLoggingFilter.java:85) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) > > at > org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:75) > at > org.apache.mina.filter.logging.MdcInjectionFilter.filter(MdcInjectionFilter.java:136) > > at > org.apache.mina.filter.util.CommonEventFilter.messageReceived(CommonEventFilter.java:70) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) > > at > org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427) > > at > org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) > > at > org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) > > at > org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:75) > at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) > at > org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:780) > > at > org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:772) > > at > org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:714) > > at java.lang.Thread.run(Thread.java:662) > [ WARN] 2013-01-25 12:05:28,479 [xxx] [127.0.0.1] Releasing unreserved > passive port: 51057 > END ---------- ---------- ---------- ---------- ---------- ---------- > ---------- > > > > > The SSLException is thrown when I cancel the upload. Can anybody help me? > What am I configuring wrong that does not let me use FTPS? > > > The system I'm running the tests in is Linux (ubuntu 12), jdk 6. > > > I appreciate any hint you can give me! > > > > Rubén Darío Páez Rivera > -- Cordialmente, ITAC S.A. [ http://www.itac.com.co/documentos/firmaITAC.gif ] www.itac.com.co Rubén Darío Páez Rivera Ingeniero Experto ITAC - IT Applications Consulting Avenida 19 # 120 – 71 Oficina 516 Bogota, DC. Colombia Telefono (+571) 7444822 ruben.p...@itac.com.co Nuestros clientes hacen parte de la calidad que brindamos por lo que lo invitamos a que si tiene una queja, reclamo o sugerencia nos la haga saber a cali...@itac.com.co -- -- Cordialmente, ITAC S.A. [http://www.itac.com.co/documentos/firmaITAC.gif] www.itac.com.co Rubén Darío Páez Rivera Ingeniero Experto ITAC - IT Applications Consulting Avenida 19 # 120 – 71 Oficina 516 Bogota, DC. Colombia Telefono (+571) 7444822 ruben.p...@itac.com.co Nuestros clientes hacen parte de la calidad que brindamos por lo que lo invitamos a que si tiene una queja, reclamo o sugerencia nos la haga saber a cali...@itac.com.co