Skip to content

Commit 42925c6

Browse files
docs: document actual reason WebID-TLS tests are skipped
The tests were skipped in 2019 with a misleading comment saying "TLS is broken". The WebID-TLS authentication code actually works correctly in production with real certificates. The test failure is a bootstrapping issue with self-signed certs: 1. Test client connects with cert containing WebID on localhost 2. Server's webid.verify() fetches that profile URL 3. Internal fetch() rejects the self-signed cert, causing timeout This commit replaces the misleading "TLS is broken" comment with accurate documentation of the actual issue and potential fixes. Related: #1841
1 parent fd8426c commit 42925c6

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

test/integration/acl-tls-test.mjs

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,39 @@ const userCredentials = {
5757
}
5858
}
5959

60-
// TODO Remove skip. TLS is currently broken, but is not a priority to fix since
61-
// the current Solid spec does not require supporting webid-tls on the resource
62-
// server. The current spec only requires the resource server to support webid-oidc,
63-
// and it requires the IDP to support webid-tls as a log in method, so that users of
64-
// a webid-tls client certificate can still use their certificate (and not a
65-
// username/password pair or other login method) to "bridge" from webid-tls to
66-
// webid-oidc.
60+
// SKIPPED: Tests timeout due to self-signed certificate verification loop.
61+
//
62+
// The WebID-TLS authentication code (lib/api/authn/webid-tls.mjs) works correctly
63+
// in production with real certificates. The test failure is a bootstrapping issue:
64+
//
65+
// 1. Test client connects with cert containing WebID https://tim.localhost:7777/profile/card#me
66+
// 2. Server calls webid.verify() which fetches that profile URL (lib/webid/lib/get.mjs)
67+
// 3. Internal fetch() rejects the self-signed certificate, causing timeout
68+
//
69+
// The NODE_TLS_REJECT_UNAUTHORIZED=0 env var is set for the test runner, but doesn't
70+
// affect the server's internal fetch() calls during WebID verification.
71+
//
72+
// ALTERNATIVE TESTS THAT WORK (see test/unit/):
73+
// - tls-authenticator-test.mjs: Tests TlsAuthenticator with mocked webid.verify()
74+
// - auth-handlers-test.mjs: Tests setAuthenticateHeader() for WebID-TLS
75+
//
76+
// SUGGESTED ADDITIONAL UNIT TESTS (no network required):
77+
// 1. Test verifyKey() directly by passing profile content as string:
78+
// import { verifyKey } from 'lib/webid/lib/verify.mjs'
79+
// verifyKey(certObj, webId, turtleProfile, 'text/turtle', callback)
80+
//
81+
// 2. Test URI extraction from certificate SAN field
82+
//
83+
// 3. Test handler behavior with/without client certificate:
84+
// - No cert → should call next() with empty session
85+
// - Cert present → should attempt verification
86+
//
87+
// To enable these integration tests, either:
88+
// - Configure a test CA that the server trusts
89+
// - Mock webid.verify() at the integration level
90+
// - Add NODE_TLS_REJECT_UNAUTHORIZED support to lib/webid/lib/get.mjs
91+
//
92+
// See: https://github.com/nodeSolidServer/node-solid-server/issues/1841
6793
describe.skip('ACL with WebID+TLS', function () {
6894
let ldpHttpsServer
6995
const serverConfig = {

0 commit comments

Comments
 (0)