GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tls: use `validateFunction` for `options.SNICallback` by deokjinkim · Pull Request #50530 · nodejs/node

Conversation

@deokjinkim

@deokjinkim deokjinkim commented Nov 2, 2023

Copy link
Copy Markdown
Contributor

If user uses invalid type for options.SNICallback in TLSSocket(), it's not internal issue of Node.js. So validateFunction() is more proper than assert().

Below is shown if we run newly added test case without this PR.

=== release test-tls-snicallback-error ===                   
Path: parallel/test-tls-snicallback-error
node:assert:635
      throw err;
      ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  Comparison {
+   code: 'ERR_INTERNAL_ASSERTION',
+   name: 'Error'
-   code: 'ERR_INVALID_ARG_TYPE',
-   name: 'TypeError'
  }
    at Object.<anonymous> (/home/deokjinkim/oss/node2/test/parallel/test-tls-snicallback-error.js:18:10)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
  Please open an issue with this stack trace at https://github.com/nodejs/node/issues
  
      at assert (node:internal/assert:14:11)
      at TLSSocket._init (node:_tls_wrap:912:5)
      at new TLSSocket (node:_tls_wrap:591:8)
      at assert.throws.code (/home/deokjinkim/oss/node2/test/parallel/test-tls-snicallback-error.js:19:5)
      at getActual (node:assert:756:5)
      at Function.throws (node:assert:902:24)
      at Object.<anonymous> (/home/deokjinkim/oss/node2/test/parallel/test-tls-snicallback-error.js:18:10)
      at Module._compile (node:internal/modules/cjs/loader:1376:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
      at Module.load (node:internal/modules/cjs/loader:1207:32) {
    code: 'ERR_INTERNAL_ASSERTION'
  },
  expected: { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' },
  operator: 'throws'
}

Node.js v22.0.0-pre
Command: out/Release/node /home/deokjinkim/oss/node2/test/parallel/test-tls-snicallback-error.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem. labels Nov 2, 2023
@deokjinkim
tls: use validateFunction for options.SNICallback
603d345
If user uses invalid type for `options.SNICallback` in
TLSSocket(), it's not internal issue of Node.js. So
validateFunction() is more proper than assert().
@deokjinkim
deokjinkim force-pushed the 231103_tls_snicallback branch from f8d52de to 603d345 Compare November 2, 2023 16:49
lpinca
lpinca approved these changes Nov 3, 2023
View reviewed changes
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 3, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 3, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 3, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55433/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@deokjinkim deokjinkim added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 4, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 10, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 609cd7f into nodejs:main Nov 10, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 10, 2023

Copy link
Copy Markdown
Collaborator

Landed in 609cd7f

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos pushed a commit that referenced this pull request Nov 11, 2023
@deokjinkim @targos
tls: use validateFunction for options.SNICallback
54c6eaa
If user uses invalid type for `options.SNICallback` in
TLSSocket(), it's not internal issue of Node.js. So
validateFunction() is more proper than assert().

PR-URL: #50530
Reviewed-By: Luigi Pinca <[email protected]>
@targos targos mentioned this pull request Nov 12, 2023
v21.2.0 release proposal #50681
Merged
targos pushed a commit that referenced this pull request Nov 14, 2023
@deokjinkim @targos
tls: use validateFunction for options.SNICallback
b71c8c4
If user uses invalid type for `options.SNICallback` in
TLSSocket(), it's not internal issue of Node.js. So
validateFunction() is more proper than assert().

PR-URL: #50530
Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
@deokjinkim @UlisesGascon
tls: use validateFunction for options.SNICallback
d905c61
If user uses invalid type for `options.SNICallback` in
TLSSocket(), it's not internal issue of Node.js. So
validateFunction() is more proper than assert().

PR-URL: #50530
Reviewed-By: Luigi Pinca <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
v20.11.0 proposal #51124
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lpinca lpinca lpinca approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@deokjinkim @nodejs-github-bot @lpinca
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.