Unable to Connect to a Site using FTPSwithData (General questions)
Converted our windows service application from the DLX COM component to the DLX .NET component and I am not able to connect to any of the FTP sites I used to connect to before.
I am able to use file zilla to connect to the sites from the server.
Using the Sample Apps this is the message i get:
STATECHANGE to Connecting to server (from Disconnected from server)
STATECHANGE to Initializing secure connection (from Connecting to server)
STATECHANGE to Setting data channel security (from Initializing secure connection)
and then it holds.
There is not a local Firewall on the server and the external firewall ahs not changed.
Can anyone give me an idea what is happening?
thanks
Re: Unable to Connect to a Site using FTPSwithData
Hi,
I presume this happens on FTPS Protocols only?
Is there any chance we can connect to that server?
Could you send us DebugFile? You can make one by setting DebugFile Property to point to some file on your computer. I.e:
Ftp1.DebugFile = C:debug.txt
If I understood, it works with ActiveX version of the component but not the .Net component?
What server does this occur on? Can you do telnet your_host 21 and tell me the first line returned?
Regards,
Damba
Re: Unable to Connect to a Site using FTPSwithData
Can not set debug parameter I get a debugfile is not a valid method
per another message
The HostCertificateEvent is handling the server certificate. Once provided wodFtpDLX automatically tries to check whether it should be trusted or not. If you however think it shouldn't you can set Args.Accept to false.
Where do I find this Args object?
site 1 220 external X2 WS_FTP Server 5.0.1 (3150692509)
site 2 220 sftp.cypresscare.com X2 WS_FTP Server 4.0.2 (3127006196)
Site 3 returns message to user xtr.southernco.com
Re: Unable to Connect to a Site using FTPSwithData
Hi Brian,
I have tried to set Accept parameter to False and it works perfectly for me in HostCertificateEvent.
Here is how I did it:
[code]
Args.Accept = False
[/code]
Problem with WS FTPS server and FTPSwithData protocol is duplicated and I will forward your problem to our main programmer Kreso to see if he can done same in debug mode.
You will probably receive reply from Kreso during a day.
Hope I helped.
Regards,
Drazen
Re: Unable to Connect to a Site using FTPSwithData
Args.accept = false
STATECHANGE to Connecting to server (from Disconnected from server)
STATECHANGE to Initializing secure connection (from Connecting to server)
STATECHANGE to Disconnected from server (from Initializing secure connection)
DISCONNECTED Connection was closed by foreign host.
Turning on blocking and using a try/catch block
System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at ..()
at WeOnlyDo.Client.FtpDLX.Connect()
at SimpleVB.Form1.button1_Click(Object sender, EventArgs e)STATECHANGE to Initializing secure connection (from Connecting to server)
STATECHANGE to Disconnected from server (from Initializing secure connection)
DISCONNECTED Connection was closed by foreign host.
Is there no longer a Debug method?
Re: Unable to Connect to a Site using FTPSwithData
Brian,
HostCertificateEvent Accept parameter should be set to True to enable access to server.
DebugFile isn't supported in wodFtpDLX.NET. You can use FtpReply Event and send us output from FtpReply Command and ReplyText parameters.
[code]
Private Sub dlxnet_FtpReplyEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.FtpReplyArgs) Handles dlxnet.FtpReplyEvent
Console.WriteLine(Args.Command & & Args.ReplyText)
End Sub
[/code]
Drazen
Re: Unable to Connect to a Site using FTPSwithData
Args.accept = true did nothing new. I tried that because I thought Args.Accept = false felt weird
ReplyEvents in log.
STATECHANGE to Connecting to server (from Disconnected from server)
ReplyEvent: external X2 WS_FTP Server 5.0.1 (1918214291)
STATECHANGE to Initializing secure connection (from Connecting to server)
ReplyEvent: AUTH TLS SSL enabled and waiting for negotiation
STATECHANGE to Setting data channel security (from Initializing secure connection)
Re: Unable to Connect to a Site using FTPSwithData
Brian,
I have receive same result on my side.
If Kreso duplicate it also, he will try to fix it and will reply to you here.
Drazen
Re: Unable to Connect to a Site using FTPSwithData
Brian,
I was too able to duplicate this problem and I believe this was a bug. It is now fixed. Please request update from our website and try it out.
Let me know how it goes!
Kreso
Re: Unable to Connect to a Site using FTPSwithData
That seems to be working now.
Thanks
Re: Unable to Connect to a Site using FTPSwithData
Ok your sample works but my code does not.
I am not using the event driven model
[code]
Try
oFTP.Blocking = True
oFTP.Hostname = FTP.URL
oFTP.LicenseKey = FTPLicenseKey
oFTP.LocalPath = procedure.LocalDir
oFTP.Login = FTP.UserName
oFTP.Passive = FTP.Passive
oFTP.Password = FTP.Password
oFTP.Protocol = CType(FTP.Protocol, WeOnlyDo.Client.Protocols)
oFTP.Port = FTP.Port
oFTP.RemotePath = procedure.RemoteDir
oFTP.Timeout = FTP.TimeOut
If oFTP.State = WeOnlyDo.Client.States.Disconnected Then
oFTP.Connect()
End If
If oFTP.State = WeOnlyDo.Client.States.Connected Then
oFTP.TransferMode = WeOnlyDo.Client.TransferModes.Binary
End If
Catch ex As Exception
Dim errString As String
errString = Site: & vbTab & FTP.FTPName & vbCrLf & Error Msg: & vbTab & oFTP.LastError.Message 'oFTP.ErrorText(oFTP.LastError)
EventLog.WriteEntry( FTP.New , errString, System.Diagnostics.EventLogEntryType.Error)
Dim oFileRoomService As New FileRoomService
FileRoomService.SendMail( Error Connecting to a FTP Server. , errString)
Throw ex
End Try
Try
oFTP.ListDir() 'Error is occuring here
Catch ex As Exception
oFTP.Disconnect()
Dim errString As String
errString = Site: & vbTab & FTP.FTPName & vbCrLf & Error Msg: & vbTab & oFTP.LastError.Message 'oFTP.ErrorText(oFTP.LastError)
EventLog.WriteEntry( FTP.New , errString, System.Diagnostics.EventLogEntryType.Error)
Dim oFileRoomService As New FileRoomService
FileRoomService.SendMail( Error Connecting to a FTP Server. , errString)
Throw ex
End Try
[/code]
I am using blocking so everything should complete before the code moves on. when I get to the ListDir line I get a Invalid PORT address on one site and a Can't open data connection. from a different site.
Please assist
I also received this from the debugger. It looks like it might be coming from inside of your component but I do not have a line number or a location in my code to trace it back to. I am going to keep looking.
System.NullReferenceException was unhandled
Message= Object reference not set to an instance of an object.
Source= WeOnlyDo.Client.FTP
StackTrace:
at ..( , Exception )
at ..(IAsyncResult )
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Re: Unable to Connect to a Site using FTPSwithData
Invalid PORT address? YOu are behind proxy/NAT. Please set Passive property to True and try again.
NAT cannot make FTP PORT address translation since it's SSL encrypted - so he doesn't see it.
Kreso
Re: Unable to Connect to a Site using FTPSwithData
Hi,
Can you maybe resend your reply?
We had some issue with our forum and it should be resolved now.
Regards,
Drazen
Re: Unable to Connect to a Site using FTPSwithData
OK,
I have a client using Ipswitch 6
We are connecting via FTPSwithData, using port 21 and passive.
I am using the VB.Net sample application to show the results.
I can connect
STATECHANGE to Connecting to server (from Disconnected from server)
STATECHANGE to Initializing secure connection (from Connecting to server)
STATECHANGE to Setting data channel security (from Initializing secure connection)
STATECHANGE to Sending authentication data (from Setting data channel security)
STATECHANGE to Connected to server - idle (from Sending authentication data)
when i listdir
STATECHANGE to Setting transfer mode (from Connected to server - idle)
STATECHANGE to Changing current directory (from Setting transfer mode)
STATECHANGE to Downloading directory list from the server (from Changing current directory)
STATECHANGE to Getting secondary data channel (from Downloading directory list from the server)
STATECHANGE to Connected to server - idle (from Getting secondary data channel)
DONE: No connection could be made because the target machine actively refused it 192.168.0.4:1217
I am able to connect to 5 different FTPSWithData sites using this tool and FileZilla.
I am not behind a proxy.
Thanks in advance for your assistance.
Re: Unable to Connect to a Site using FTPSwithData
Hi Ogedei,
The latest error you described, No connection could be made because the target machine actively refused it means that there is no server listening on specified hostname/port.
Are you perhaps behind some firewall? Can you please check? Even windows firewall could cause problems.
Also, can you try setting StrictHost property? Does that help?
regards,
Damba
Re: Unable to Connect to a Site using FTPSwithData
OK,
So I have been banging on this for some time now, and i have a new peice of info:
FileZilla is logging Server sent passive reply with unroutable address. Using server address instead.
Can you help me understand what this means?
Re: Unable to Connect to a Site using FTPSwithData
Ogedei,
Can you please try setting StrictHost property to True before connecting and try it out?
Regards,
Damba
Re: Unable to Connect to a Site using FTPSwithData
How would that affect the clients that are working currently?
This code is re-used by multiple FTP sites.
Re: Unable to Connect to a Site using FTPSwithData
Does this mean the remote site is returning an invalid IP address?? Or is the routing happeing in my network?
Re: Unable to Connect to a Site using FTPSwithData
Ogedei,
It means that server sent an incorrect IP address in response to PASV command. When StrictHost is set, the component will ignore that IP, and use the one specified in HostName property.
While FileZilla handles it automatically, wodFtpDLX is component, so you need to determine if you will use it or not for specific hosts.
regards,
Damba
Re: Unable to Connect to a Site using FTPSwithData
I added oFTP.StrictHost to the code posted on 5/9/2007 and I am still having issues connecting
the client is using GlobalScape FTP
I have a user name and password for you to use to test connect but do not feel comfortable posting it here, please contact me for the login information.
I am struggling greatly with the forms of secure FTP and these internal non-routable ip addresses being returned from the ftp servers.
thanks for your support
Re: Unable to Connect to a Site using FTPSwithData
Hi,
You can provide us with any sensitive info by sending and e-mail to techsupport@weonlydo.com
Regards,
Damba