Skip to content

(new TLSSocket(new net.Socket())).connect() fails silently. #3963

Closed
@Havvy

Description

@Havvy

(EDIT by @Trott: Turns out this is a documentation bug. Labeling good-first-contribution and doc.)

"use strict";

const NetSocket = require("net").Socket;
const TlsSocket = require("tls").TLSSocket;

const tlsSocket = new TlsSocket(new NetSocket());

tlsSocket.once("connect", function doStartup () {
    console.log("The tls socket connected. Yay!");
});

tlsSocket.connect({port: 6697, host: "irc.freenode.net"});
console.log("Sent connect.");

The program ends immediately after the connect is called, telling me that the connection isn't started.

Note that if we don't wrap the net.Socket in a TLSSocket, then the connect works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.good first issueIssues that are suitable for first-time contributors.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions