Curl and libssh2

I have modified WP77XX firmware release 9.1 to allow SFTP by adding libssh2 to curls PACKAGECONFIG.
When I try to connect to an sftp server libssh2 is returning the error LIBSSH2_ERROR_SOCKET_RECV
Does anybody know what might cause this?

Hi @shib,
When we tried with WP7702 to connect to sftp using the “curl -v -k -u demo:password s” , 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 logs. We are looking into it.

root@swi-mdm9x28-wp:~# curl -v -k -u demo:password s
* Rebuilt URL to: s
*   Trying
* Connected to ( port 22 (#0)
* Failure establishing ssh session
* Closing connection 0
curl: (2) Failure establishing ssh session

Muralidhara N.

Hi Muralidhara,

This is the same error that I was experiencing.
To find out what error code libssh2 was emitting, I created and applied this patch:

--- a/lib/ssh.c	2018-07-09 16:42:12.000000000 +1000
+++ b/lib/ssh.c	2018-11-07 12:51:09.245299347 +1100
@@ -667,7 +667,7 @@
       if(rc) {
-        failf(data, "Failure establishing ssh session");
+        failf(data, "Failure establishing ssh session, error %d", rc);
         state(conn, SSH_SESSION_FREE);
         sshc->actualcode = CURLE_FAILED_INIT;

I just called it libssh2-debug.patch and added it to the SRC_URI of curl_7.58.0bb.
Running the previous command with that patch applied shows libssh2 returning with error -43, LIBSSH2_ERROR_SOCKET_RECV.
That was as far as I got debugging this issue.

Hi @shib,
Thanks for the clarification, Even we see same error --43 is returned when we tried printing the error code.

We are trying looking into this, Will let you know for any further updates.

Muralidhara N.

Hello Muralidhara,

I know you said you would let me know if there were any updates, but i’m going to ask anyway.
Are there any updates?

Hi @shib,
We had informed this to our R&D, They have suggested to try access over ecm.
Officially we don’t support SFTP, But our R&D team trying to look further into this issue depending on the bandwidth they have.

Muralidhara N.

Hi Muralidhara.

What is ecm?

You say that you don’t officially support SFTP, but you include an SFTP server on the device?
I appreciate you passing the issue on to R&D. This is a deal breaker for us, if there is any way to expedite the issue through some paid support, can you please PM me some details?


Hi @shib,
We have informed the same(expedite the issue through some paid support) to our R&D, Will let you know once they come back with the details.

Muralidhara N.

1 Like