Page 1 of 1

Object name Missing

Posted: Tue 13 Sep 2022 16:16
by xDBInformatique
Hello,

I'm having trouble connecting to an sFTP server. Message is
Object name missing
This happens in the OnServerKeyValidation procedure

Code: Select all

procedure TFGestionPackingList.DoServerKeyValidate(FileStorage: TScFileStorage;
  const HostKeyName: string; NewServerKey: TScKey; var Accept: Boolean);
var
  Key: TScKey;
  fp, msg: string;
begin
  Key := FileStorage.Keys.FindKey(HostKeyName);
  showmessage('1');
  if (Key = nil) or not Key.Ready then begin
    NewServerKey.GetFingerPrint(haMD5, fp);
    msg := 'The authenticity of server can not be verified.'#13#10 +
           'Fingerprint for the key received from server: ' + fp + '.'#13#10 +
           'Key length: ' + IntToStr(NewServerKey.BitCount) + ' bits.'#13#10 +
           'Are you sure you want to continue connecting?';

    if MessageDlg(msg, mtConfirmation, [mbOk, mbCancel], 0) = mrOk then begin
       Key := TScKey.Create(nil);
        showmessage('2');
      try
        Key.Assign(NewServerKey);
        showmessage('3');
        Key.KeyName := HostKeyName;
       showmessage('4');
        [color=#FF0000][b]FileStorage.Keys.Add(Key);  <<== ERROR
        showmessage('5');
      except
        Key.Free;
        raise;
      end;

      Accept := True;
    end;
  end;
end;
I can't understand, because if I use the demo it works, if I use Filezilla it works..
This software is used directly on the server as an administrator

Could you help me ?

Cordially.

Re: Object name Missing

Posted: Tue 13 Sep 2022 17:13
by xDBInformatique
I'm back,

When I use the Demo sFTPClient Devart I get a message asking me to validate a key.
I then find myself with a .Key file present in the application directory!
If I place my application in the same directory it works !!! So I guess my application uses this .key file

What I don't understand is why with my application the .key file is not created and gives me an "Object name missing" error, yet I'm answering the same question as in the DEVART Demo project!!

Thanks for your help