Title: `tls.connect()` aborts process on malformed ALPNProtocols instead of throwing an error · Issue #65069 · nodejs/node · GitHub
Open Graph Title: `tls.connect()` aborts process on malformed ALPNProtocols instead of throwing an error · Issue #65069 · nodejs/node
X Title: `tls.connect()` aborts process on malformed ALPNProtocols instead of throwing an error · Issue #65069 · nodejs/node
Description: Version v26.7.0 Platform Darwin MacBook-Pro-2.local 25.0.0 Darwin Kernel Version 25.0.0: Tue Aug 5 22:46:55 PDT 2025; root:xnu-12377.1.6~5/RELEASE_ARM64_T6000 arm64 (bas Subsystem No response What steps will reproduce the bug? Run the fo...
Open Graph Description: Version v26.7.0 Platform Darwin MacBook-Pro-2.local 25.0.0 Darwin Kernel Version 25.0.0: Tue Aug 5 22:46:55 PDT 2025; root:xnu-12377.1.6~5/RELEASE_ARM64_T6000 arm64 (bas Subsystem No response What ...
X Description: Version v26.7.0 Platform Darwin MacBook-Pro-2.local 25.0.0 Darwin Kernel Version 25.0.0: Tue Aug 5 22:46:55 PDT 2025; root:xnu-12377.1.6~5/RELEASE_ARM64_T6000 arm64 (bas Subsystem No response What ...
Opengraph URL: https://github.com/nodejs/node/issues/65069
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`tls.connect()` aborts process on malformed ALPNProtocols instead of throwing an error","articleBody":"### Version\n\nv26.7.0\n\n### Platform\n\n```text\nDarwin MacBook-Pro-2.local 25.0.0 Darwin Kernel Version 25.0.0: Tue Aug 5 22:46:55 PDT 2025; root:xnu-12377.1.6~5/RELEASE_ARM64_T6000 arm64\n(bas\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nRun the following command:\n\n```bash\nnode -e \"require('node:tls').connect({ host: '127.0.0.1', port: 9999, ALPNProtocols: [''] })\"\n````\n\nThe process aborts with SIGABRT.\n\nThe same issue can be reproduced with malformed ALPN wire format buffers:\n\n```js\nBuffer.from([0])\nBuffer.from([2, 0x61])\nBuffer.from([1, 0x61, 0x62])\n```\n\npassed as `ALPNProtocols`.\n\n### How often does it reproduce? Is there a required condition?\n\nIt reproduces consistently (100% of the time).\n\nRequired condition:\n\n* Node.js TLS client API is used through `tls.connect()`;\n* `ALPNProtocols` contains an invalid ALPN protocol list;\n* The invalid input reaches the native TLS implementation.\n\nNo network interaction is required.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe expected behavior is that Node.js rejects the invalid input by throwing a JavaScript exception (for example `ERR_INVALID_ARG_VALUE`) instead of terminating the process.\n\n`ALPNProtocols` is a documented API option supporting string arrays and Buffer/Uint8Array inputs. Invalid values should be handled as invalid arguments and remain recoverable application errors.\n\n### What do you see instead?\n\nThe entire Node.js process aborts.\n\nThe failure occurs in `TLSWrap::SetALPNProtocols()`:\n\n```cpp\nCHECK_EQ(0, SSL_set_alpn_protos(ssl, protos.data(), protos.length()));\n```\n\nWhen OpenSSL rejects the malformed ALPN list, the CHECK assertion fails and Node exits with SIGABRT (exit code 134).\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/brown-sussy","@type":"Person","name":"brown-sussy"},"datePublished":"2026-08-06T06:02:57Z","url":"https://github.com/nodejs/node/issues/65069"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8b00ae8d-2645-df9b-cc38-89565e83bc5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C244:119BBD:B94681:F18AEE:6AED4824 |
| html-safe-nonce | 60212e41015cb8496f5ea94ab3a6bdd95b812197e9bbf3d7cee82bb88d600ed4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjQ0OjExOUJCRDpCOTQ2ODE6RjE4QUVFOjZBRUQ0ODI0IiwidmlzaXRvcl9pZCI6IjExNTQxMjA3MjU2OTQzMzUwMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 033d2f5deccfb06a4f87cd643b0eb9456ee40dee57ecd50edacb7cd31c34006c |
| hovercard-subject-tag | issue:5078145412 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65069/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2fa637dbd29bcb464bdbc8c9e63b14ccbe0dbbc1a435b25aac6d77e17a31c664/nodejs/node/issues/65069 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2fa637dbd29bcb464bdbc8c9e63b14ccbe0dbbc1a435b25aac6d77e17a31c664/nodejs/node/issues/65069 |
| og:image:alt | Version v26.7.0 Platform Darwin MacBook-Pro-2.local 25.0.0 Darwin Kernel Version 25.0.0: Tue Aug 5 22:46:55 PDT 2025; root:xnu-12377.1.6~5/RELEASE_ARM64_T6000 arm64 (bas Subsystem No response What ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brown-sussy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width