EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTP from in-browser Silverlight app fails

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#19097
Posted: 02/15/2012 16:54:25
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10

Hi.

I'm encountering an error when I try to FTP with an in-browser Silverlight app. The EEIFTPSError exception has the message 'Control channel transfer error'. This only happens when running in-browser. This is straight FTP (not FTPS).

I have set the FTP server to listen on port 4503 and also have set PASV ports to 4505 - 4534, to accommodate the Silverlight limitations. I've also put proper clientaccesspolicy.xml file, and SFTP is working in-browser. Out of browser seems to work fine.

The code below should be able to reproduce the issue:

Code
            TElSimpleFTPSClient client = new TElSimpleFTPSClient();
            client.Socket.ClientAccessPolicyProtocol = SBSocket.TElSocketClientAccessPolicyProtocol.cappHttp;
            client.UseSSL = false;
            client.Port = 4503;
            client.Address = "IPAddressHere";
            client.Username = "username";
            client.Password = "password";
            client.AdjustPasvAddress = true;

            client.Open();
            client.Login();

            client.OnProgress += new SBUtils.TSBProgressEvent(client_OnProgress);
            using (FileStream fs = fileInfo.OpenRead())  // I have fileInfo passed
            {
                client.Send(fs, fileInfo.Name);
            }

            client.Close(false);


Would appreciate some guidance to go forward with this please.

Thanks.
Muljadi Budiman.
#19098
Posted: 02/15/2012 17:05:06
by Ken Ivanov (EldoS Corp.)

FTP uses a secondary socket connection for data transfers. Therefore, the ClientAccessPolicyProtocol should be also configured for that secondary socket:

client.DataSocket.ClientAccessPolicyProtocol = SBSocket.TElSocketClientAccessPolicyProtocol.cappHttp;
#19101
Posted: 02/16/2012 08:51:10
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10

Hi Innokentiy.

client.DataSocket seems to always be null - I'm even looking at handling OnControlReceive / OnControlSend event and can't see it being populated. That property is also read-only so I can't just create my own SBSocket.

Any other suggestions? I would almost expect if the DataSocket is created within the class, it should follow the settings of the client.InternalSocket, so the ClientAccessPolicyProtocol should be copied as well.

Thanks.
Muljadi Budiman.
#19103
Posted: 02/16/2012 09:01:30
by Ken Ivanov (EldoS Corp.)

Hi Muljadi,

You appear to be right. The data socket object is created right before the data connection is initiated, so you won't be able to access it on an earlier stage. We will update the component to copy the policy protocol setting from the control channel socket, this will eliminate the issue.

Thank you for pointing us at this.
#19104
Posted: 02/16/2012 09:06:59
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10

Thank you Innokentiy.

If you guys need someone to test / verify the update, I'd be willing to give it a spin.

Thanks.
Muljadi Budiman.
#19106
Posted: 02/16/2012 10:13:22
by Ken Ivanov (EldoS Corp.)

Thank you for that. We've just updated the FTPS component according to the above discussion. Just in case if you have a spare moment and a will to check if it resolves the issue for you, I'll upload the updated assembly to your Helpdesk ticket.
#19107
Posted: 02/16/2012 10:34:14
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10

Hi.

Definitely appreciate the fast turnaround; verified the new assembly works - now both in-browser and non-elevated OOB Silverlight app have the FTP works wonderfully.

Thank you Innokentiy - I'll look forward to the Monday refresh.

Ciao.
Muljadi Budiman.
#19108
Posted: 02/16/2012 10:59:06
by Ken Ivanov (EldoS Corp.)

Wonderful, thank you very much for checking that!
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 1607 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!