-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting with ftp ends in 501 error #44
Comments
Hi, there is an event named |
Hello, Wow, very fast reply. I used the events you suggested and got this Reply:220 WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law. By accessing this system, you agree that your actions may be monitored if unauthorized usage is suspected. I'm guessing here, but my current thinking is that this is a local network configuration issue. They changed the server and they might have forgotten some networking config in a firewall somewhere. |
Apparently you are using active connections, which work only if your client has a public IP that the server can reach. Otherwise, you should stick to passive transfers ( |
You are right, I recheck previous code and the server requires passive to be true. I must have changed that while testing. unfortunately it just gives me another error: Reply:220 WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law. By accessing this system, you agree that your actions may be monitored if unauthorized usage is suspected. I can reach the server from local desktop, but I'm debugging on a remote server. On the remote server also cannot connect using filezilla. Should have tested that first :(. So must be a local network problem. Thanks again for the support. p.s. It worked before and only started to malfunction after server upgrade to use TLS, the admins over here must have made a mistake. |
Not sure it's their fault, unfortunately. We had trouble with FileZilla server and I never really understood why. If you have time for tests and fix, you are welcome :) |
Sorry, must be a translation error. We are mostly doing development work on remote desktops/machines (rdp) over here. So server and client lines get blurred somewhere sometimes. I was referring to testing with the filezilla client on local and on a remote machine, and then connecting to the same Microsoft ftp server. We are not using FileZilla server so I cannot help diagnose that. I have now verified that the code works on local but not remote clients. That means fire walling somewhere. So you are not saving our network guys :) from work :) |
Hello,
I'm trying to connect to an ftp server using ftpes. I checked with filezilla and the server does require explicit TLS ftp. When connecting I get an CheckCertificate and the valid property equals true. After that any command returns 501 ('Server cannot accept argument.'). Is there an easy way to see which command is causing this? At this moment I only have stack trace which is not very informative. It happens as soon as I hit HasFeature in code below.
The ftp server is the built in microft ftp server and output from FEAT is
Response: 211-Extended features supported:
Response: LANG EN*
Response: UTF8
Response: AUTH TLS;TLS-C;SSL;TLS-P;
Response: PBSZ
Response: PROT C;P;
Response: CCC
Response: HOST
Response: SIZE
Response: MDTM
Response: REST STREAM
Response: 211 END
Stacktrace:
at ArxOne.Ftp.FtpSession.ThrowException(FtpReply reply)
at ArxOne.Ftp.FtpSession.Expect(FtpReply reply, Int32[] codes)
at ArxOne.Ftp.FtpSession.OpenActiveDataStream(TimeSpan connectTimeout, TimeSpan readWriteTimeout)
at ArxOne.Ftp.FtpSession.OpenDataStream(Boolean passive, TimeSpan connectTimeout, TimeSpan readWriteTimeout, FtpTransferMode transferMode, Nullable
1 streamMode) at ArxOne.Ftp.FtpClientUtility.OpenDataStream(FtpSession session, FtpTransferMode transferMode, FtpStreamMode streamMode) at ArxOne.Ftp.FtpClientUtility.ProcessList(FtpSession session, FtpPath path) at ArxOne.Ftp.FtpClient.Process[TResult](Func
2 action, FtpSession session)at ArxOne.Ftp.FtpClientUtility.ListEntries(FtpClient ftpClient, FtpPath path)
at NugetHelper.Program.Main(String[] args) in \Program.cs:line 36
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
using (var ftpClient = new FtpClient(new Uri("ftpes://ftp.*****"), new NetworkCredential("****", "******"), new FtpClientParameters() { Passive = false, })) { ftpClient.CheckCertificate += FtpClient_CheckCertificate; if (ftpClient.ServerFeatures.HasFeature("MLSD")) { var temp = ftpClient.MlsdEntries("/"); //.Mlsd(new FtpPath("/")); } }
The text was updated successfully, but these errors were encountered: