SFTP

tried also this way:

https://community.intersystems.com/post/ssh-authentication-error-invalid-key-data-not-base64-encoded

recreated the keys following that topic, updated the file server, now I’m getting
SSH public key authentication failed: Callback returned error

Filezilla still connect with new keys!

this is the error…

  • SSH public key authentication failed: Callback returned error
  • Failure connecting to agent
  • Authentication failure
  • Closing connection 0
    curl: (67) Authentication failure

Feel free to send me something via email like a test key for a test account.

send an email with attachments to you christian

I converted key from ppk to pem with puttygen tool.

see
https://tecadmin.net/convert-ppk-to-pem-using-command/

Now it works with

Dim f As FolderItem = GetFolderItem("test.pem") d.OptionSSHPrivateKeyfile = f.NativePath

here. I can get directory listing.

thak you Christian! now works…

but I’m having a problem when downloading the files, they are created 0kb !

in this way I perform a scan of the listfiles

dim fileList() as string = ListaFiles
if fileList.Ubound = -1 then Return // nothing?
dim commands() as string

for each filename as string in fileList 
  if filename.Right(4)="N001" then
    dim url as string = Self.url.text+filename
    percorsofile = Self.url.text+filename
    dim parts() as string = split(url, "/")
    dim name as string = parts(UBound(parts)) 
    dim DestinationFile as FolderItem =  SpecialFolder.Desktop.Child(name)
    
    DoDownload url, DestinationFile
  end if
next

Listafiles

select case e
case 0
  // get output and show it. Maybe fix encoding
  s = d.OutputData
  if s.Encoding = nil then
    if encodings.UTF8.IsValidData(s) then
      s = DefineEncoding(s, encodings.UTF8)
    else
      s = DefineEncoding(s, encodings.ISOLatin1)
    end if
  end if
  
  s = ReplaceLineEndings(s, EndOfLine)
  
  editfield1.text=s
  
  ''ciro
  dim items() as string = split(s, EndOfLine)
  if items.Ubound >= 0 and items(0) = "." then
    items.Remove 0
  end if
  if items.Ubound >= 0 and items(0) = ".." then
    items.Remove 0
  end if
  Return items
  ''ciro
  
  
else
  s=""
  
  // show debug messages
  s = d.DebugData
  if s.Encoding = nil then
    if encodings.UTF8.IsValidData(s) then
      s = DefineEncoding(s, encodings.UTF8)
    else
      s = DefineEncoding(s, encodings.ISOLatin1)
    end if
  end if
  
  s = ReplaceLineEndings(s, EndOfLine)
  editfield1.text=s
end select

ResultText.text="Result: "+str(e)+" "+d.LasterrorMessage

and then I download every file

d = new CURLSMBS

if not d.CreateMTOutputFile(dest) then
  MsgBox "Failed to create file."
  Return
end if

'd.OptionURL = URL
d.OptionURL = percorsofile

// optional with credentials
'd.OptionUsername = "xxx"
'd.OptionPassword = "xxx"

// timeouts
'd.OptionConnectionTimeout = 10
'd.OptionTimeOut = 60

// more flags
d.OptionVerbose = true
d.OptionSSLVerifyHost = 0
d.OptionSSLVerifyPeer = 0

Result = d.PerformMT

d.CloseMTOutputFile

// show result
dim s as string = d.OutputData
break
if s.Encoding = nil then
  s = DefineEncoding(s, encodings.ISOLatin1)
end if
s = ReplaceLineEndings(s, EndOfLine)
ResultText.text = "Result: "+str(result)
d = nil

When you stream to file the OutputData property is always empty. And please check DebugData property for log messages.

s = d.DebugData

s is always empty

s = d.DebugData

never enters this case

Are you sure?

Did you perform the query?
What is result?
Did you set ssh private key on the connection, too?

[quote=427902:@Christian Schmitz]Are you sure?

Did you perform the query?
What is result?
Did you set ssh private key on the connection, too?[/quote]
I’m able to see the files but when downloading them they’re created 0kb

dim s as string = d.OutputData

s is always empty