Jump to content
pdiaz

Error with PrivateKey

Recommended Posts

Hello
I´m developing with delphi 10.2.3 and I need to connect to sftp site  with a privateKey 
 
The source code it´s very simple.
I have only assigned this parameters
 FtpClient1.HostName           := 'sftp.....';
 FtpClient1.Port                       := 'port';
 FtpClient1.UserName           := 'user';
 SslContext1.SslPrivKeyFile    := 'PrivateKeyProd.ppk';
 if FtpClient1.Connect then
       Display('Command Success');
 else
       Display('Command Failure');
 
I have also dll requerid
libcrypto-1_1.dll
libssl-1_1.dll
 
But I only received this mistake (see attached image)
It is possible to connect via SFTP?? 
Thanks 

ErrorSftpWithPrivateKey.png

Share this post


Link to post

Depends what you think SFTP means, there is no standardised protocol with that name. 

 

If you mean FTP over SSH with a private key, ICS does not support that. 

 

If you mean FTP using SSL/TLS, then ICS does support it, But the source code is not as simple as  you think, clients don't need a private key or SSL certificate, only servers, unless you are trying to implement client certificates which is very rare.  ICS also does not recognise files with extension PPK, nor whatever content you have in it which is what the OpenSSL error effectively says.  But you don't need it.

 

There are several ICS FTP example applications, I suggest you build Samples\delphi\sslinternet\OverbyteIcsXferTst.dpr first.

 

Angus

 

Share this post


Link to post

I've been using WinSCP to perform SFTP where I needed it. The software runs on servers under my control, so it's no problem to have WinSCP installed there. If you call CreateProcess on WinSCP.com with the /nointeractiveinput and the correct command line parameters, you can have a series of command complete and give predictable output you can process.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×