Medium trust security problems

0 votes
asked Aug 16, 2010 by andy jones (120 points)
edited Aug 7, 2012

i am attempting to use Rebex ftp using a shared virtual server, CloudSites from www.rackspace.com. This hosting strictly imposes medium trust restrictions. when I run the app on my development PC which runs IIS locally -no problem. Same code on the host I get the following error message.

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Is there something I can set or switch off to make it work.

Googling this, i see this is a medium trust

My application is an ASP.NET version 3.5 web based application rather than windows forms

Code which fails

Dim ftp As New Ftp()
ftp.Connect("ftp.ibexis.com", 21)
Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Aug 16, 2010 by Martin Vobr (12,940 points)
edited Aug 16, 2010

Unfortunately, there are some permissions we need that are not available in medium trust. For example, one of them is System.Net.SocketPermission – this allows us to utilize TCP sockets to access FTP server. Without SocketPermission we are unable to connect to network.

Is it possible to ask rackspace to prepare a customized permission set for you and add at least SocketPermission?

Some methods (like using proxy with NLMN or Windows integrated authentication) also require permission to execute unmanaged code but if you do not call them rest of app should execute fine).

commented Aug 16, 2010 by andy jones (120 points)
unfortunately Rackspace requires that all applications conform to medium trust condtions. Can you prepare a customised version which does not sue socketpermission? If not I am unable to use this control and would kindly request a refund. Thanks
commented Aug 17, 2010 by Martin Vobr (12,940 points)
The SocketPermission means that application is allowed to communicate over network. Creating a functional FTP component without using this permission is impossible to anyone, sorry. Regarding refund - sure, no problem - each order come with a money back guarantee (30 days by default). To request a refund send us your order number to support@rebex.net.
...