TIdFTP + SSL

Giganews Newsgroups
Subject: TIdFTP + SSL
Posted by:  Steve Flitman (user@domain.invalid)
Date: Tue, 25 Jan 2005

I am having trouble with this in Indy 10, getting

Exception EIdTLSClientTLSNotAvailable
"Start SSL Negotiation Command failed"

when I call FTP->Connect()

My TIdFTP is set up as follows:

// set host, username, password from host entry
FTP->Host=params->find("Domain");
FTP->Username=params->find("Username");
FTP->Password=params->find("Password");

// if security requested, set it up
if (s=="Normal") {
    FTP->IOHandler=NULL;
    FTP->UseTLS=utNoTLSSupport;
    FTP->DataPortProtection=ftpdpsClear;
} else
if (s=="Fallback" || s=="Secure") {          // doesn't work
    FTP->IOHandler=Form1->SSLIOHandler;
    FTP->UseTLS=utUseRequireTLS;
    FTP->DataPortProtection=ftpdpsPrivate;
}

// connect
FTP->Connect();

I have Form1->SSLIOHandler, a TIOSSLHandlerSocketOpenSSL component, with
the following non-default properties:

SSLOptions.CertFile="class3.cer";    // x509 class 3 root certificate
SSLOptions.CipherList="";        // don't know what to put here
SSLOptions.KeyFile="";            // do I need this, I'm a client
SSLOptions.Method=sslvSSLv23;
SSLOptions.Mode=sslmClient;
SSLOptions.RootCertFile="";        // different from CertFile?
SSLOptions.VerifyDepth=2;
SSLOptions.VerifyDirs="";        // ?
SSLOptions.VerifyMode=[sslvrfPeer];

I haven't set any event handlers for SSLIOHandler

Any help greatly appreciated!

Steve

Replies