Hi

I am trying to get FTP over SSL to work and it's getting to me now :/.

The code is strait forward:
........
<snippet>

ServicePointManager.ServerCertificateValidationCallback += new
System.Net.Security.RemoteCertificateValidationCallback(justReturnTrue);
System.Net.FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(url);
ftp.KeepAlive = true;
ftp.Credentials = new System.Net.NetworkCredential(usr.Text, pwd.Text);
ftp.Proxy = null;//not supported by upload.
ftp.UseBinary = true;
ftp.UsePassive = true;
ftp.ContentLength = mem.Length;

ftp.Method = WebRequestMethods.Ftp.UploadFile;
ftp.EnableSsl = true;

stream = ftp.GetRequestStream();
........
</snippet>

The GetRequestStream throws this exception :

"The server returned an address in response to the PASV command that is
different than the address to which the FTP connection was made."

The trace file shows that an SSL connection is made but when entering the
passive mode it throws the exception.

I understand that the client it connecting at one endpoint but receives
another endpoint from the server to start the secure
conversation ....followed by a "hmm ?"

Has someone encountered the same problem here and solved it ?.

If I turn passive mode off, I get a "(530) Not logged in." and if I smack
the keyboard hard enough I get "system halt" followed by a blue screen ? :)


As a note: the ftp site actually does allow uploading files without the
use of SSL, so could it be the ftp site has some issues (besides the
obvious security flaw).

Best regards Allan

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to