Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions images/runtimes/nodejs22.2.0/Dockerfile.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ RUN make -j $(nproc) test-build
RUN out/Release/node --check test/common/index.js \
&& out/Release/node --check test/parallel/test-http-outgoing-end-cork.js

# Select the certificate for www.nodejs.org in the CA interaction test.
COPY tls-servername.patch /tmp/tls-servername.patch
RUN patch -p1 --no-backup-if-mismatch < /tmp/tls-servername.patch \
&& out/Release/node --check test/internet/test-tls-add-ca-cert.js \
&& rm -f /tmp/tls-servername.patch

# Including dumb-init emulates the Linux "init" process, preventing the failure
# of tests involving worker processes.
ENTRYPOINT ["/usr/bin/dumb-init"]
14 changes: 14 additions & 0 deletions images/runtimes/nodejs22.2.0/tls-servername.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# tls.connect does not send SNI by default, so the server otherwise
# selects its default certificate instead of the one for www.nodejs.org.
# https://nodejs.org/api/tls.html#tlsconnectoptions-callback
# Upstream: https://github.com/nodejs/node/pull/66835
diff --git a/test/internet/test-tls-add-ca-cert.js b/test/internet/test-tls-add-ca-cert.js
--- a/test/internet/test-tls-add-ca-cert.js
+++ b/test/internet/test-tls-add-ca-cert.js
@@ -27,5 +27,6 @@ const caCert = loadPEM('ca1-cert');
const opts = {
host: 'www.nodejs.org',
+ servername: 'www.nodejs.org',
port: 443,
rejectUnauthorized: true,
};
Loading