Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: Indy 10 and secure FTP
| Subject: | Re: Indy 10 and secure FTP |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 10 Jan 2008 09:48:50 |
"Warren O. Merrill" <warren.merrill@inl.gov> wrote in message
news:4785899a$1@newsgroups.borland.com...
> Followup questions. This code is called from a couple of places which
> send in the info on what server to connect with. Its possible that some
> places still want a regular FTP connection and some want to use a
> secure connection.
Simply assign/unassigned the IOHandler property, or set the UseTLS property,
before calling Connect() each time.
> Once I add the handler will it still work as a regular connection also?
Yes, but you have to tell TIdFTP not to use its SSL capabilities. That is
what the UseTLS property is for.
> If it tries to connect with a server and the server is just FTP will it
> still
> connect okay but if the server is wanting a secure connection then it
> will use that mode instead?
In order to do that, you have to set the UseTLS property to utUseExplicitTLS
while an SSL IOHandler is assigned. When logging in, TIdFTP will then ask
the server if an encrypted connection is allowed. If it is not, an
exception will be raised that you can catch in order to reset the UseTLS
property back to utNoTLSSupport and attempt to login normally instead.
Gambit
none