Link to home
Start Free TrialLog in
Avatar of AlHal2
AlHal2Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Download from FTP site using encryption

I'm using this visual studio 2008code to download from a site using TLS/SSL Implicit encryption.
SessionOptions sessionOptions = new SessionOptions
                    {
                        //obtain SshHostKeyFingerprint by opening winscp, clicking on commands in menu then choosing server and protocol information
                        Protocol = Protocol.Ftp ,
                        HostName = "vykftp.borsaistanbul.com",
                        UserName = "rtrs",
                        Password = "zzz",
                        PortNumber = 990
                       
                    };

Open in new window

I'm getting this error message.
WinSCP.SessionRemoteException: Connection failed. ---> WinSCP.SessionRemoteException: Timeout detected.

Assuming the password is correct, what am I doing wrong?
Avatar of Kimputer
Kimputer

I'd say you should try this first:
replace
Protocol = Protocol.Ftp ,
with
Protocol = Protocol.sFtp ,

Also, always try with the WinSCP windows client first to check if all parameters are correct (server, username, password etc)
If you checked everything, and it doesn't connect, you're going to mess with your code, even if your code wasn't at fault (maybe it was a server side problem).
Avatar of AlHal2

ASKER

I tried the WINSCP windows client.  Protocol is ftp.
It uses TLS/SSL Implicit encryption.
servername, hostname and password are correct.
I could connect to the site with winscp using these details.
To get the certificate I clicked on commands in menu then choosing server and protocol information.
I got this error message.
SessionOptions.TlsHostCertificateFingerprint or SessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate is set, but SessionOptions.FtpSecure is FtpSecure.None.
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlHal2

ASKER

Thanks.