You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When connecting to an SFTP using Curl/Multi with a provided password, it appears to get stuck at login.
This only seems to apply to some SFTP servers, perhaps depending on supported auth types?
I managed to reproduce the same behavior when passing an incorrect password to another server.
To Reproduce
import{Curl}from'node-libcurl'constcurl=newCurl()curl.setOpt('URL','sftp://nxtest:foobar@10.0.1.209/')curl.setOpt('SSL_VERIFYHOST',0)curl.setOpt('SSL_VERIFYPEER',0)curl.setOpt('VERBOSE',true)// This should force it to only use provided password I think, but doesn't help// curl.setOpt('SSH_AUTH_TYPES', 2)// This will make the request timeout// curl.setOpt('CONNECTTIMEOUT', 10)// None of these trigger...curl.on('data',(chunk)=>{console.log('DATA',chunk.toString())})curl.on('header',(chunk)=>{console.log('HEADER',chunk.toString())})curl.on('end',(statusCode,body,headers)=>{console.info('Status Code: ',statusCode)console.info('Headers: ',headers)console.info('Body length: ',body.length)curl.close()})curl.on('error',(error,errorCode)=>{console.error('Error: ',error,errorCode)curl.close()})curl.perform()// necessary to keep process alivesetTimeout(()=>console.log('done waiting'),20e3)
The output:
* Trying 10.0.1.209:22...
* Connected to 10.0.1.209 (10.0.1.209) port 22 (#0)
* User: nxtest
* Authentication using SSH public key file
done waiting
When using Easy it works correctly (just replaced Curl with Easy and removed event-listeners):
* Trying 10.0.1.209:22...
* Connected to 10.0.1.209 (10.0.1.209) port 22 (#0)
* User: nxtest
* Authentication using SSH public key file
* Completed password authentication
* Authentication complete
* Connection #0 to host 10.0.1.209 left intact
Also when using curl cli:
$ curl -k -v sftp://nxtest:foobar@10.0.1.209/
* Trying 10.0.1.209:22...
* Connected to 10.0.1.209 (10.0.1.209) port 22 (#0)
* User: nxtest
* Authentication using SSH public key file
* Completed password authentication
* Authentication complete
drwxr-xr-x 3 root root 4096 May 3 2023 docker
drwxr-xr-x 7 root root 4096 Nov 27 14:03 homes
drwxrwxrwx 4 root root 4096 Dec 14 14:59 SMB-test
drwxrwxrwx 8 nxtest users 4096 Apr 26 2023 home
* Connection #0 to host 10.0.1.209 left intact
I also tried a simple c application using multi, and it worked correctly:
Hi @deadbeef84 thanks for the report. I am not finding time right now to look into these, but as soon as go through my backlog on project I will try to reproduce your issue.
Describe the bug
When connecting to an SFTP using Curl/Multi with a provided password, it appears to get stuck at login.
This only seems to apply to some SFTP servers, perhaps depending on supported auth types?
I managed to reproduce the same behavior when passing an incorrect password to another server.
To Reproduce
The output:
When using
Easy
it works correctly (just replacedCurl
withEasy
and removed event-listeners):Also when using curl cli:
I also tried a simple c application using multi, and it worked correctly:
Output:
Version information:
Version:
OS: Ubuntu 22.04.3 LTS
Node.js Version: v20.9.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: