Curl and libssh2


#1

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?


#2

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 logs. 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.


#3

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 @@
         break;
       }
       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;
         break;

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.


#4

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.

Regards,
Muralidhara N.


#5

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?


#6

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.

Regards,
Muralidhara N.


#7

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?

Thanks.


#8

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.

Regards,
Muralidhara N.