Page 1 of 1

Host key not verified

Posted: Tue 27 Aug 2019 16:06
by angy_abacom
Hello
I want to use the SFTPClient component to upload a file to an SFTP server.

I used the following code:

Code: Select all

SSHOpera.HostName: = fFTP_AD;
SSHOpera.User: = fFTP_LOGIN;
SSHOpera.Password: = fFTP_MDP;
SSHOpera.Port: = fFTP_PORT;
SSHOpera.Connect;

SFTPOpera.Initialize;
if Typetransfert = 'VENTE' then
            begin
              SFTPOpera.UploadFile(IncludeTrailingBackslash(Chemin_Recherche) + sr.Name, IncludeTrailingBackslash(fFTP_Vente) + sr.Name, False);
            end
            else
            begin
              SFTPOpera.UploadFile(IncludeTrailingBackslash(Chemin_Recherche) + sr.Name, IncludeTrailingBackslash(fFTP_Achat) + sr.Name, False);
            end;

             SFTPOpera.Disconnect;
             SSHOpera.Disconnect;

Code: Select all

procedure TFrmExport_Opera.SSHOperaServerKeyValidate(Sender: TObject;
  NewServerKey: TScKey; var Accept: Boolean);
begin
  Accept := True;
end;
I get the following error:
Host key not verified

Can you help me solve the problem?

Re: Host key not verified

Posted: Wed 28 Aug 2019 11:43
by ViktorV
Please clarify the issue you encountered using our SFTPClient demo project. You can find the SFTPClient project in the %SecureBridgeDemos%\SFTPClient directory. %SecureBridgeDemos% is the SecureBridge Demo projects installation path on your computer.
If the issue is not reproduced on our SFTPClient demo project, please bring you code into accordance with the code used in our SFTPClient project. Otherwise, please compose a full sample demonstrating the specified behavior and send it to us using the contact form https://www.devart.com/company/contactform.html, in order for us to provide you a more detailed answer.