parro-it / open-ssh-tunnel

Easy ssh2 tunneling
MIT License
53 stars 7 forks source link

Cannot connect to SSH when use private key #17

Open hckhanh opened 4 years ago

hckhanh commented 4 years ago

Hi @parro-it, I receive this error when try to use private key. I try all type: string or Buffer, but it doesn't work.

The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received undefined

This is full error log:

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of B
uffer or ArrayBuffer. Received undefined
    at Function.byteLength (buffer.js:713:11)
    at SSH2Stream.directTcpip (C:\Users\hoang\WebstormProjects\open-ssh-tunnel\node_modules\ssh2-s
treams\lib\ssh.js:1156:23)
    at openChannel (C:\Users\hoang\WebstormProjects\open-ssh-tunnel\node_modules\ssh2\lib\client.j
s:1161:21)
    at Client.forwardOut (C:\Users\hoang\WebstormProjects\open-ssh-tunnel\node_modules\ssh2\lib\cl
ient.js:1010:10)
    at C:\Users\hoang\WebstormProjects\open-ssh-tunnel\index.js:49:10
    at new Promise (<anonymous>)
    at forwardConnection (C:\Users\hoang\WebstormProjects\open-ssh-tunnel\index.js:41:9)
    at createClientServer (C:\Users\hoang\WebstormProjects\open-ssh-tunnel\index.js:80:8)
    at createClientServer.next (<anonymous>)
    at onFulfilled (C:\Users\hoang\WebstormProjects\open-ssh-tunnel\node_modules\co\index.js:65:19
)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}
JTBrinkmann commented 3 years ago

This issue probably comes due to a different missing parameter in your configuration (e.g. srcAddr).