57
Views
3
Comments
Solved
[SFTP] Error when using privateKey
sftp
Service icon
Forge asset by Paulo Ramos
Application Type
Service

Hello.


I have always used the application to send files via SFTP with username and password. However, they suddenly changed, and now it will be via privateKey.


I set up the structure and tested it, but without success, I received the following error: "Key "OPENSSH" is not supported."


I joined the community, and saw a post saying to use the latest version, so I updated the component to version 5.3.3. And now, I get the following error: ""Could not load type 'Renci.SshNet.IPrivateKeySource' from assembly 'Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106'."


As the flow is a timer, I saved my privateKey in the resources, and passed its content in the component's PUT.


Can you help me?

2023-03-30 10-13-40
Miguel Antunes
Solution

Hi Bernardo,

In the latest version (5.3.3), I overlooked the fact that OutSystems Platform internally uses an older version of SSH.NET, preventing the use of a newer version on the SFTP component.

Now, SFTP v5.3.4 includes re-Namespace Renci.SshNet v2024 for its functionality, separating it from the OS platform core usage by adopting the Namespace "OS.SSH.Net". 

This means that the method you're trying to use should be available. Can you please update the component to version 5.3.4 and report back if that issue you are facing is solved?

2021-05-25 20-26-04
Bernardo Condé

Hello Miguel,

I updated and the error presented disappeared, but it still didn't work. Now I get the following error "An error occurred while uploading the file to the SFTP server."

To validate that our privateKey was working, we tried accessing it through an external application called winscp and it worked normally.

2023-03-30 10-13-40
Miguel Antunes

If you share a sample .oml file with your logic, or even a screenshot of the flow, it will be easier for others to understand and help you.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.