C# FTP Client Access Through ISA Server

  • Thread starter Thread starter Phil Ruelle
  • Start date Start date
P

Phil Ruelle

Hi,

I've got an FTP client written in C# which works fine when directly
accessing the internet.

However I need to update it so that it can FTP through an ISA proxy
server. I have downloaded a number of samples but can't get any of
them to work with the proxy.

There appears to be two approaches:

1) Tunnel FTP through HTTP
http://groups.google.com/groups?hl=...oxy+c%23+connect+http&ie=UTF-8&oe=UTF-8&hl=en
I've tried this and the problem I have is that the ISA server is set
to 'integrated authentication' so I get a 407 error response.
Is there a simple way to generate the proxy-authentication header for
NTLM? The client is written in C# so I have access to the .Net classes
but there doesn't seem to be anything suitable - I've looked at
NetworkCredentials but have no idea how this would translate to a HTTP
header.

2) Extend WebRequest/WebResponse
I've had a look through the code for the Microsoft sample (KB 166691)
and it seems to be plain wrong. For example:
a) in OpenControlConnection it tries to get a response after the
socket connection - this hangs indefinitely
b)in GetResponse if a proxy username is defined it processes it into
(e-mail address removed)
c) it connects a socket to the proxy server and then tries to send FTP
commands straight to this socket - do they not have to be wrapped up
to prevent the proxy server from trying to parse/execute them?
I'd be grateful if anyone could explain what's going on here - have I
misunderstood how it works? Has anyone used this architecture as the
basis for a working FTP client via a proxy server (which requires
authentication)?

Finally is there an alternative solution (apart from reconfiguring the
ISA security)?

Thanks in advance,
Phil
 
Hello

Does your FTP client support PASV mode? If it does try it.

Best regards,
Sherif
 
I think if you use the WinInet funcs to do the HTTP/1.1 CONNECT, then that
might handle the different auth method.
 
(e-mail address removed) (Phil Ruelle) wrote in
I've only ever used passive mode, in fact it doesn't even support
active.

What kind of component does not support Active?
 
(e-mail address removed) (Phil Ruelle) wrote in
this and the problem I have is that the ISA server is set to 'integrated
authentication' so I get a 407 error response. Is there a simple way to
generate the proxy-authentication header for NTLM? The client is written

Yes, but NTLM is not trivial. Indy has FTP and NTLM support
(www.indyproject.org) but I dont remember if the NTLM parts were ported to
..net yet or not.
c) it connects a socket to the proxy server and then tries to send FTP
commands straight to this socket - do they not have to be wrapped up
to prevent the proxy server from trying to parse/execute them?

This is HTTP proxy open port. But you will still need to auth against ISA for
it to let you out.
 
Back
Top