0 votes
by (320 points)

Hi Team,

We are receiving the error message "530 Non-anonymous sessions must use encryption" while connecting to the FTP from Rebex API. Below is the code we have written to connect.

Ftp client = new Ftp();
client.Connect(ServerName, PortNumber);
client.Login(UserName, Password);

The Connect method is working fine. But while calling the Login method, we are receiving the given error message.

If we set the Encryption as "Require explicit FTP over TLS" option in the FileZilla, it is working fine.

Please let us know how we can set the "Require explicit FTP over TLS" option in the Rebex code to connect the FTP. Thank you.

Regards,
Naga Suresh D

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (73.6k points)

It is very simple, just use SslMode.Explicit when connecting:

client.Connect(ServerName, PortNumber, SslMode.Explicit);
by (320 points)
I have added SslMode.Explicit and the Connect method is just stuck and not completing the execution of the Connect method. It took around 5 minutes of time and throws an error "The operation was not completed within the specified time limit.".

Below is the stack trace of the error.

   at mmjx.klja()
   at mmjx.kljh()
   at Rebex.Net.TlsSocket.uodb()
   at xcyi.sfok(TlsParameters acu)
   at Rebex.Net.Ftp.pcam(TlsParameters fj, FtpSecureUpgradeType fk)
   at Rebex.Net.Ftp.pcad(String fa, Int32 fb, TlsParameters fc, SslMode fd, FtpSecureUpgradeType fe)
   at Rebex.Net.Ftp.Connect(String serverName, Int32 serverPort, SslMode security)



Please help me to fix this issue. Thank you.
by (73.6k points)
Can you please create communication log and post it here or send it to support@rebex.net for analysis?

It can be created as described at https://www.rebex.net/kb/logging/

If you can include the log from FileZilla, it would be helpful to.
by (320 points)
I have sent both Rebex and FileZilla logs to support@rebex.net email. Please have a look and help me to fix the issue in Rebex as the issue exists in the production. Thank you.
by (73.6k points)
Did you receive my response from 12th March?
I am able to connect to your Ftp server from my computer using Rebex libraries successfully.
According to the log files, it seems that you used FileZilla at your personal machine, but the Rebex log is produced at production machine. Is it correct?
by (320 points)
Hi Lukas,

Sorry for the delayed reply on this. I have received the email but I was on leave till today. Hence I was unable to send a reply to you.

For your question, Yes. I have connected the reported from my local machine with Rebex. And I have connected the FTP from the production machine with the File Zilla.

If you are able to connect the FTP from the Rebex, can you please let me know which property or method need to write additionally to connect it. Thank you.
by (73.6k points)
I am able to connect to your FTP server with this code:

    Ftp client = new Ftp();
    client.Connect("xxxxxxx.com", SslMode.Explicit);

I only replaced server-name since I am not sure, whether you want to share it here.
...