nodejs / nodejs/node

new tls.TLSSocket issue

Open
#31,305 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

confirmed-bug doc tls
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

  • Version: 10.x+
  • Platform: All
  • Subsystem: tls

When I try to create a secure connection over an existing stream, implementing something similar to STARTTLS, the suggested way is to use new tls.TLSSocket().

I also want to use mutual certification authentication but the tlsSocket.authorized is never set to true for the Server even when the client certificate is signed correctly by the expected CA. From the _tls_wrap.js code, it seems this flag is only set for the server when the underlying stream is an actual socket.

On the client side things are working as expected, as the client side connection is created with tls.connect().

It used to be that the deprecated pair returned by tls.createSecurePair() has access to the internal SSL object, which I can use verifyError() to check the validity of the client certificate. But this hidden feature has also been removed in recent versions.

What is the correct approach to mca for "upgraded" connection?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with _tls_wrap.js and the TLSSocket construction path described in the report; compare it with the tls.connect() path and the former tls.createSecurePair() behavior. Confirm how mutual-certificate verification is exposed for upgraded streams, then define completion as a supported, testable approach or a clearly documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.