Atozed Forums
TIdFtp property DataPortProtection - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Indy (https://www.atozed.com/forums/forum-8.html)
+--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html)
+--- Thread: TIdFtp property DataPortProtection (/thread-2693.html)



TIdFtp property DataPortProtection - dragonstar - 03-30-2022

Good day all.
 
Working in Delphi 10.2...
 
I found a tip from Remy on StackOverflow that says if a connection needs encryption I need to set .DataPortProtection to ftpdspPrivate.
 
When I try to do this at design time I get a message "Can not set DataPortProtection with unencrypted connections" - is there some other property on the TIdFtp or TIdSSLIOHandlerSocketOpenSSL objects I need to set?
 
Or do I set this in code after I've connected?  If so, I tried that and ftpdpsPrivate isn't recognized - what unit do I need o add to my uses clause?
 
 
drc  Smile


RE: TIdFtp property DataPortProtection - dragonstar - 03-30-2022

(03-30-2022, 01:16 PM)dragonstar Wrote: NEVER MIND - found it.
 
 drc   Smile



RE: TIdFtp property DataPortProtection - rlebeau - 03-30-2022

(03-30-2022, 01:16 PM)dragonstar Wrote: When I try to do this at design time I get a message "Can not set DataPortProtection with unencrypted connections"

That error happens if you try to set the TIdFTP.DataPortProtection property when the TIdFTP.UseTLS property is set to utNoTLSSupport. You have to assign an SSLIOHandler and then enable SSL/TLS via UseTLS before you can then set the DataPortProtection.

(03-30-2022, 01:16 PM)dragonstar Wrote: ftpdpsPrivate isn't recognized - what unit do I need o add to my uses clause?

It is declared in the IdFTPCommon unit.