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.