Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm:ssh2 times out waiting for handshake #18313

Closed
GJZwiers opened this issue Nov 16, 2022 · 2 comments
Closed

npm:ssh2 times out waiting for handshake #18313

GJZwiers opened this issue Nov 16, 2022 · 2 comments
Labels
bug Something isn't working correctly node compat

Comments

@GJZwiers
Copy link
Contributor

GJZwiers commented Nov 16, 2022

npm:ssh2 does not work in Deno right now, it hangs for a bit and then throws.

import { Client } from "npm:ssh2";

const client = new Client();
client.on("ready", () => {
  console.log("Client :: ready");
  client.exec("uptime", (err, stream) => {
    if (err) throw err;
    stream.on("close", (code, signal) => {
      console.log("Stream :: close :: code: " + code + ", signal: " + signal);
      client.end();
    }).on("data", (data) => {
      console.log("STDOUT: " + data);
    }).stderr.on("data", (data) => {
      console.log("STDERR: " + data);
    });
  });
}).connect({
  host: "<some_ip>",
  port: 22,
  username: "<some_user>",
  privateKey: Deno.readFileSync(/path/to/my/key.pem"),
});
error: Uncaught Error: Timed out while waiting for handshake
    at Timeout.<anonymous> (file:///C:/Users/GJZwiers/AppData/Local/deno/npm/registry.npmjs.org/ssh2/1.11.0/lib/client.js:1014:23)
    at https://deno.land/std@0.164.0/node/timers.ts:21:15
    at Object.action (deno:ext/web/02_timers.js:147:13)
    at handleTimerMacrotask (deno:ext/web/02_timers.js:64:12)

It looks like ssh2 uses a number of methods from Node crypto that are not implemented in std yet:

  • createDecipheriv
  • createDiffieHellman
  • createDiffieHellmanGroup
  • createECDH,
  • createHmac
  • createPublicKey
  • createSign
  • createVerify
  • diffieHellman
  • generateKeyPairSync
  • sign
  • verify

Deno version: 1.28.0

@GJZwiers GJZwiers added bug Something isn't working correctly needs triage labels Nov 16, 2022
@emogua
Copy link

emogua commented Nov 25, 2022

Keep watching this!

@kt3k kt3k transferred this issue from denoland/std Mar 21, 2023
@GJZwiers
Copy link
Contributor Author

Closing in favor of #18455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

3 participants