I am not able to transfer text file over FTPS (with TLS). I am able to establish connection with FTPS server. Able to change the directory, but whenever i am trying to upload the file i am getting below log error. I have given both code details as well as error log details. please help. Below is my code snippet for transferring file through FTPS server. Chilkat.Ftp2 ftp = new Chilkat.Ftp2(); The Error log got from Chilkat - ---------Upload Error --------- ChilkatLog: PutFile: DllDate: Aug 30 2017 ChilkatVersion: 9.5.0.69 UnlockPrefix: Anything for 30-day trial Architecture: Little Endian; 32-bit Language: .NET 4.5 VerboseLogging: 0 RemoteFilename: test.txt LocalFilename: C:Testtest.txt ProgressMonitoring: enabled: yes heartbeatMs: 0 sendBufferSize: 65536 --ProgressMonitoring IdleTimeoutMs: 60000 ReceiveTimeoutMs: 60000 ConnectTimeoutSeconds: 30 soRcvBuf: 4194304 soSndBuf: 262144 uploadFromLocalFile: localFileSize: 39 uploadFromDataSource: initialGreeting: 220 PwC CFT FTP Server restartNext: 0 modeZ: 0 binaryMode: 1 pbsz_protp: simpleCommand: sendCommand: sendingCommand: PROT P --sendCommand readCommandResponse: replyLineQP: 200 Protection level set to P --readCommandResponse --simpleCommand --pbsz_protp setupDataConnection: passive transfer mode setupPassiveDataSocket: sendCommand: sendingCommand: PASV --sendCommand readCommandResponse: replyLineQP: 227 Entering Passive Mode (172,31,120,157,19,203) --readCommandResponse dataConnect: hostname: 172.31.120.157 port: 5067 socket2Connect: connect2: ConnectFailReason: Connection rejected A few possible causes for a connection being rejected are: - A firewall (software or hardware), such as Windows Firewall, is blocking the connection . - Nothing is listening at the remote host:port --connect2 --socket2Connect dataConnectSuccess: 0 --dataConnect setupPassiveDataSocket dataConnect failed. --setupPassiveDataSocket Failed to setup passive data socket --setupDataConnection Failed to setup data connection for upload. readRepliesAfterFailedDataConn: readCommandResponse: Failed to read beginning of SSL/TLS record. b: 0 dbSize: 0 nReadNBytes: 0 idleTimeoutMs: 1000 Failed to receive more TLS application data. tlsApp: Socket operation timeout. elapsedMs: Elapsed time: 1031 millisec Failed to read FTP control channel reply. readFtpReply: Socket operation timeout. --readCommandResponse --readRepliesAfterFailedDataConn --uploadFromDataSource Failed. --uploadFromLocalFile TotalTime: Elapsed time: 22219 millisec Failed. --PutFile --ChilkatLog |
No luck. I have tried this option. But same error I am getting. In my code I am using different port(20017) rather than default port. I have set port number in my code. But in log I can see the different port 5067 like below. Could you please let me know if that makes any issue. dataConnect: hostname: 172.31.120.157 port: 5067 socket2Connect: connect2: |
Hello, 5067 is the port used for data transfer. It seems that cannot arrive at 172.31.120.157 , port 5067. Maybe a local firewall or a remote firewall is locking connection. Try it disabling local firewall and local antivirus. Regards, Hi Team, Thanks for you answer. I just need one confirmation - Is Data connection can only be connected through 5067 port? I have put port value as 20017, but that seems not getting overwritten according to the log. So, please confirm if data connection need to be open only through 5067 port. No other open port won't work. Thanks & Regards, Sabari Ghosh
(Oct 06 '17 at 01:41)
Sabari Ghosh
|
See http://cknotes.com/determining-ftp2-connection-settings/ Also, try adding a rule to Windows Firewall that allows your app's executable (.exe) to pass. No need to disable the entire firewall just for testing.. :) |
Hello, the port used for passive data transfer is established by the ftp server. In most of ftp servers you can set the port range used in passive transfers. In Windows 2008 R2 and above using IIS server for ftp server you can set port range. In Linux the majority of ftp servers you can set port range. Regards, |
Hi David, The FTP server to which I am connecting has opened port 20017 for data connection. In the code using chilkat dll I have set the port to 20017. But in log it says that its trying to connect to the port no 5067. Do you have any ideas regarding this. Or is it something constraints of chilkat dll that it is not able override the port number. Please suggest me. Waiting for your reply. Thanks, Sabari |