Skip to content

Can't seem to use TLS #13

@sntran

Description

@sntran

When trying to connect to an FTP server with TLS, I encounter issue with Deno.startTls.

Example:

import { FTPClient } from "https://raw.githubusercontent.com/nullobsi/ftpdeno/main/mod.ts";

const client = new FTPClient("ftp.dlptest.com", {
  user: "dlpuser",
  pass: "rNrKYTX9g7z3RgJRmxWuGHbeu",
  port: 21,
  tlsOpts: {
  }
});

await client.connect();
console.log("Connected!");
$ deno run -A ftp.js 
error: Uncaught (in promise) BadResource: TCP stream is currently in use
            this.conn = await Deno.startTls(this.conn, {
                                   ^
    at opStartTls (ext:deno_net/02_tls.js:10:15)
    at Object.startTls (ext:deno_net/02_tls.js:88:57)
    at FTPClient.connect (https://raw.githubusercontent.com/nullobsi/ftpdeno/main/classes/FTPClient.ts:170:27)
    at eventLoopTick (ext:core/01_core.js:178:11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions