Skip to content

feat(playwright): install certutil so keploy's CA reaches the browser - #42

Merged
slayerjain merged 1 commit into
mainfrom
feat/playwright-certutil
Oct 28, 2026
Merged

slayerjain merged 1 commit into
mainfrom
feat/playwright-certutil

Conversation

@slayerjain

@slayerjain slayerjain commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What this does

keploy-ci-playwright now ships certutil (Debian's libnss3-tools), so the Chromium that Playwright drives can trust keploy's CA when a lane runs under keploy.

On Linux, Chromium takes its trusted CAs from the user's NSS database ($HOME/.pki/nssdb), not from the system store. keploy adds its CA there with certutil while it runs and removes it at exit (keploy/keploy#4958).

  • What the image had: libnss3, which Playwright's install-deps brings.
  • What it lacked: certutil, which is in the separate libnss3-tools package.
  • What that broke: without certutil keploy warns once and adds nothing. Chromium then refuses keploy's certificate, and every HTTPS call a Playwright test makes through keploy ends in a failed handshake. Those calls are neither recorded nor served.

The package is pinned the same way the image pins its other tools: ARG NSS_TOOLS_VERSION=2:3.110-1+deb13u4, the nss build the image's libnss3 is at. When Debian replaces that build, the archive stops serving it and the build fails at the install step, naming the version. The fix then is to bump the ARG. The verify step also checks that certutil is on PATH.

Proof

  • On an enterprise-ui lane: two lanes (access-rbac, smart-set-pagination) were recorded with keploy mock record and feat(tls): add keploy's CA to the NSS database so Chromium and Firefox trust it keploy#4958. remote error: tls: unknown certificate went from 93 to 0 and from 18 to 0 once the lane installed libnss3-tools.
  • Built on an amd64 box: the published playwright-1.2.49 has no certutil (its libnss3 is 2:3.110-1+deb13u4). This Dockerfile builds on node-1.2.49. In the result, certutil creates a database, adds a CA with trust C,,, lists it and removes it. libnss3-tools depends on libnss3 (>= 2:3.101).

Known limits

…oy's CA

On Linux, Chromium takes its trusted CAs from the user's NSS database
($HOME/.pki/nssdb), not from the system store. keploy now adds its CA there
with certutil while it runs (record, test, mock record, mock replay) and
removes it at exit (keploy branch feat/ca-nss-db-next). The Playwright image
has libnss3, which install-deps brings, but not certutil, which is in the
separate libnss3-tools package. Without it keploy warns once and adds
nothing, Chromium refuses keploy's certificate, and every HTTPS call a
Playwright test makes through keploy ends in a failed handshake: on two
enterprise-ui lanes recorded with keploy mock record, 93 and 18 handshakes
("remote error: tls: unknown certificate"), each a call neither recorded nor
served. With certutil installed in the lane, both went to 0.

The image now installs libnss3-tools, pinned like the image's other tools
(NSS_TOOLS_VERSION=2:3.110-1+deb13u4, the build its libnss3 is at), and its
verify step checks that certutil is on PATH.

Checked on an amd64 box: the published playwright-1.2.49 has no certutil
(libnss3 2:3.110-1+deb13u4); this Dockerfile builds on node-1.2.49, and in the
result certutil creates a database, adds a CA with trust C,,, lists it and
removes it.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain marked this pull request as ready for review October 28, 2026 12:53
@slayerjain
slayerjain merged commit 827ad4d into main Oct 28, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant