Title: fix: make WebID profile fetch respect NODE_TLS_REJECT_UNAUTHORIZED in tests · Issue #1843 · nodeSolidServer/node-solid-server · GitHub
Open Graph Title: fix: make WebID profile fetch respect NODE_TLS_REJECT_UNAUTHORIZED in tests · Issue #1843 · nodeSolidServer/node-solid-server
X Title: fix: make WebID profile fetch respect NODE_TLS_REJECT_UNAUTHORIZED in tests · Issue #1843 · nodeSolidServer/node-solid-server
Description: Problem The WebID-TLS integration tests timeout because the internal fetch() in lib/webid/lib/get.mjs doesn't respect NODE_TLS_REJECT_UNAUTHORIZED=0. When verifying a WebID certificate, the server fetches the user's profile (e.g., https:...
Open Graph Description: Problem The WebID-TLS integration tests timeout because the internal fetch() in lib/webid/lib/get.mjs doesn't respect NODE_TLS_REJECT_UNAUTHORIZED=0. When verifying a WebID certificate, the server ...
X Description: Problem The WebID-TLS integration tests timeout because the internal fetch() in lib/webid/lib/get.mjs doesn't respect NODE_TLS_REJECT_UNAUTHORIZED=0. When verifying a WebID certificate, the ser...
Opengraph URL: https://github.com/nodeSolidServer/node-solid-server/issues/1843
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix: make WebID profile fetch respect NODE_TLS_REJECT_UNAUTHORIZED in tests","articleBody":"## Problem\n\nThe WebID-TLS integration tests timeout because the internal `fetch()` in `lib/webid/lib/get.mjs` doesn't respect `NODE_TLS_REJECT_UNAUTHORIZED=0`.\n\nWhen verifying a WebID certificate, the server fetches the user's profile (e.g., `https://tim.localhost:7777/profile/card#me`). In tests, this URL uses a self-signed certificate that the internal fetch rejects.\n\n## Simplest Fix (~5 lines)\n\nModify `lib/webid/lib/get.mjs` to use an HTTPS agent that respects the environment variable:\n\n```javascript\nimport fetch from 'node-fetch'\nimport https from 'https'\nimport { URL } from 'url'\n\n// Respect NODE_TLS_REJECT_UNAUTHORIZED for testing with self-signed certs\nconst agent = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0'\n ? new https.Agent({ rejectUnauthorized: false })\n : undefined\n\nexport default function get (webid, callback) {\n // ... existing code ...\n fetch(uri.href, { method: 'GET', headers, agent })\n // ...\n}\n```\n\n## Why This Works\n\n- In production: `NODE_TLS_REJECT_UNAUTHORIZED` is not set, so normal cert validation applies\n- In tests: The env var is already set by the test runner (`cross-env NODE_TLS_REJECT_UNAUTHORIZED=0`)\n- No changes needed to test infrastructure or certificates\n\n## After This Fix\n\nRemove `describe.skip` from `test/integration/acl-tls-test.mjs` and the tests should pass.\n\n## Related\n\n- #1841 - Original tracking issue\n- #1842 - Documentation PR explaining the issue","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-08T23:12:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1843/node-solid-server/issues/1843"}
| 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:40648a69-6a12-020e-0777-741106c0c80f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85B2:3E21CF:BE6F4:100113:69718AE1 |
| html-safe-nonce | b3805ae28412d576196d1ca4c7a0f29972fcc67fd7f931541c9db92ab1bd083e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUIyOjNFMjFDRjpCRTZGNDoxMDAxMTM6Njk3MThBRTEiLCJ2aXNpdG9yX2lkIjoiMjIxNDg2MzA5MjQxMzcyOTUwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2f7dfb9abf18644781117d772f94d26ae368a29e6a34b70c248d3f272d783d38 |
| hovercard-subject-tag | issue:3794789886 |
| 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/nodeSolidServer/node-solid-server/1843/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dcd7770856f0d54edf00131e5dfc3added0e7bad6b38b8af58b824f989f46656/nodeSolidServer/node-solid-server/issues/1843 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dcd7770856f0d54edf00131e5dfc3added0e7bad6b38b8af58b824f989f46656/nodeSolidServer/node-solid-server/issues/1843 |
| og:image:alt | Problem The WebID-TLS integration tests timeout because the internal fetch() in lib/webid/lib/get.mjs doesn't respect NODE_TLS_REJECT_UNAUTHORIZED=0. When verifying a WebID certificate, the server ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b0f2f00499ad3dd2c21ad030a3c403edca54df20ea256f6517c6d8c4fa3a1a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodeSolidServer/node-solid-server git https://github.com/nodeSolidServer/node-solid-server.git |
| octolytics-dimension-user_id | 104446421 |
| octolytics-dimension-user_login | nodeSolidServer |
| octolytics-dimension-repository_id | 24306004 |
| octolytics-dimension-repository_nwo | nodeSolidServer/node-solid-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24306004 |
| octolytics-dimension-repository_network_root_nwo | nodeSolidServer/node-solid-server |
| 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 | 67235153f3c1514ed5f7dc469f138abc377bd388 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width