From cebe6ae7244ce9e0918791c1c99cd34b5619c37d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 19 Oct 2026 19:40:24 +0200 Subject: [PATCH] C4: loopback HTTPS test credential for the content parity test Self-signed P-256 pair for 127.0.0.1, CA:FALSE, serverAuth, with the openssl recipe in the README. Co-Authored-By: Claude Opus 5.5 --- .../cultmesh-browser/test/fixtures/README.md | 22 +++++++++++++++++++ .../test/fixtures/content-https-test-cert.pem | 13 +++++++++++ .../test/fixtures/content-https-test-key.pem | 5 +++++ 3 files changed, 40 insertions(+) create mode 100644 packages/cultmesh-browser/test/fixtures/README.md create mode 100644 packages/cultmesh-browser/test/fixtures/content-https-test-cert.pem create mode 100644 packages/cultmesh-browser/test/fixtures/content-https-test-key.pem diff --git a/packages/cultmesh-browser/test/fixtures/README.md b/packages/cultmesh-browser/test/fixtures/README.md new file mode 100644 index 00000000..37f1a976 --- /dev/null +++ b/packages/cultmesh-browser/test/fixtures/README.md @@ -0,0 +1,22 @@ +# Test fixtures + +`content-https-test-cert.pem` and `content-https-test-key.pem` are a loopback-only +test credential. They sign nothing real: the certificate is self-signed P-256, valid +for `127.0.0.1` and `localhost`, `CA:FALSE`, `serverAuth` only, and the key is public +on purpose. + +They exist for `interop/content-https.test.ts`. The TypeScript provider serves HTTPS +with this pair. The C# suite (`CultMeshHttpsContentInteropTests`) anchors the +certificate with `CustomRootTrust`, so chain and name validation stay on and no +other certificate is accepted. The TypeScript reader trusts it through +`NODE_EXTRA_CA_CERTS`, set on the reader's child process only. + +Regenerate (Git Bash needs the `MSYS_NO_PATHCONV=1` prefix); no test pins the bytes: + + openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \ + -keyout content-https-test-key.pem -out content-https-test-cert.pem -days 36500 \ + -subj "/CN=cultmesh-content-https-tests" \ + -addext "subjectAltName=IP:127.0.0.1,DNS:localhost" \ + -addext "basicConstraints=critical,CA:FALSE" \ + -addext "keyUsage=critical,digitalSignature" \ + -addext "extendedKeyUsage=serverAuth" diff --git a/packages/cultmesh-browser/test/fixtures/content-https-test-cert.pem b/packages/cultmesh-browser/test/fixtures/content-https-test-cert.pem new file mode 100644 index 00000000..635b3ca5 --- /dev/null +++ b/packages/cultmesh-browser/test/fixtures/content-https-test-cert.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB5TCCAYugAwIBAgIUYu2AT96reiPh11v9xCTtZyIk3F4wCgYIKoZIzj0EAwIw +JzElMCMGA1UEAwwcY3VsdG1lc2gtY29udGVudC1odHRwcy10ZXN0czAgFw0yNjEw +MTkxNzM3MzlaGA8yMTI2MDkyNTE3MzczOVowJzElMCMGA1UEAwwcY3VsdG1lc2gt +Y29udGVudC1odHRwcy10ZXN0czBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABLrV +DZdr7rly5z4D6XCzEFnL3njGBw/XSfGJBqsvtnLv7biP++PUx/otGhk2FpfJCa8s +RSS6tr1KlJAinDwQfT+jgZIwgY8wHQYDVR0OBBYEFHNEAAq4I/qya72ulYoItVKu +AV8TMB8GA1UdIwQYMBaAFHNEAAq4I/qya72ulYoItVKuAV8TMBoGA1UdEQQTMBGH +BH8AAAGCCWxvY2FsaG9zdDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAT +BgNVHSUEDDAKBggrBgEFBQcDATAKBggqhkjOPQQDAgNIADBFAiAhM5txvdC+43aZ +EbHYftYUY2BnJuOV9fdDyJF3jgyLGgIhALS6Zq5/KQyBWaYzdExrlpuXyl60eSz5 +aQVLg5FGjIpX +-----END CERTIFICATE----- diff --git a/packages/cultmesh-browser/test/fixtures/content-https-test-key.pem b/packages/cultmesh-browser/test/fixtures/content-https-test-key.pem new file mode 100644 index 00000000..7f76b6b4 --- /dev/null +++ b/packages/cultmesh-browser/test/fixtures/content-https-test-key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgBpkdByjhxCucHa5P +jvQD6psI8I1cTwOqBKefGsyP8SehRANCAAS61Q2Xa+65cuc+A+lwsxBZy954xgcP +10nxiQarL7Zy7+24j/vj1Mf6LRoZNhaXyQmvLEUkura9SpSQIpw8EH0/ +-----END PRIVATE KEY-----