Libcurl cant find libssh2

I have a WP7700 running Legato 18.6.1, and a customized yocto build enabling sftp in curl.
To enable sftp I have added libssh2 to curls PACKAGECONFIG.

Previously I have been able to use sftp in libcurl after doing this, but it seems something has changed between 16.10.3 that is causing some issues.

Running curl -V tells me it is compiled with libssh2 and that it supports sftp, but curl_version_info(CURL_VERSION_NOW) tells me libssh_version is null and does not list sftp in its protocols.

I have been stuck on this for what feels like forever. Any ideas or suggestions would be greatly appreciated.

I have managed to get this working, but only when I compile my app through windows.

My yocto image builds successfully and generates yocto_wp77xx.4k.cwe.
I can send the updated yocto image through windows or a Ubuntu virtual machine no problem.

I have an app on a git repository, so the app on Windows and Ubuntu is the same.

When I build the app on Ubuntu curl -V tells me that curl was compiled with libssh2 and it includs sftp in its protocol list, but curl_version_info(CURL_VERSION_NOW) has a different version string, libssh_version string is null, and it does not include sftp in its list of protocols.

When I build the app on Windows, libcurl now has the correct version, libssh_version string is correct. and sftp is in its list of protocols.

I have tried removing and reinstalling the app but it makes no difference. The app built in Ubuntu will always show a different curl version from libcurl and it won’t include sftp.

Can anybody tell me where I am going wrong? This seems pretty bizarre to me.

Hi @shib,
With which application you are trying? Can you please provide the complete application with which you are trying to call curl commands/APIs.

We will check building the application on Ubuntu and try on our side.

Regards,
Muralidhara N.

Hello Muralidhara,

I have since moved past this problem, I will have a look later today to see if it is reproducible or if it is/was a localised issue.

While I have your attention though, I do have a different issue that is reproducible. I posted it on the Sierra Wireless forum because no posts here seem to get any dev attention.

Here is the post in question.

To reproduce the issue.

  1. Download firmware release 9.1 for WP7700
  2. Add libssh2 to curl_7.58.0.bb in meta-swi/common/recipes-support/curl/
  3. Build
  4. Run from command line: curl -V
  5. Run from command line: curl -v -k -u demo:password sftp://test.rebex.net
  6. Repeat from step 2 with firmware release 16 for WP8548

When you compare the output of curl -V you will see they are compiled the same.
The WP8548 successfully connects using sftp.
The WP7700 fails to connect using sftp. However, it can establish an ssh connection to the server.

Ok. So you are having issues connecting to sftp with WP7700. We will try to check the same on our side.

Regards,
Muralidhara N.

1 Like

Hi @shib,
When we tried with WP7702 to connect to sftp using the “curl -v -k -u demo:password sftp://test.rebex.net” , It fails to connect to sftp throwing an error “Failure establishing ssh session”

Below are the complete logs, Please confirm whether you also see the same result. We are looking into it.

root@swi-mdm9x28-wp:~# curl -v -k -u demo:password sftp://test.rebex.net
* Rebuilt URL to: sftp://test.rebex.net/
*   Trying 195.144.107.198...
* TCP_NODELAY set
* Connected to test.rebex.net (195.144.107.198) port 22 (#0)
* Failure establishing ssh session
* Closing connection 0
curl: (2) Failure establishing ssh session

Regards,
Muralidhara N.