Repository navigation
feat(playwright): install certutil so keploy's CA reaches the browser - #42
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
keploy-ci-playwrightnow shipscertutil(Debian'slibnss3-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 withcertutilwhile it runs and removes it at exit (keploy/keploy#4958).libnss3, which Playwright'sinstall-depsbrings.certutil, which is in the separatelibnss3-toolspackage.certutilkeploy 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'slibnss3is 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 thatcertutilis onPATH.Proof
access-rbac,smart-set-pagination) were recorded withkeploy mock recordand feat(tls): add keploy's CA to the NSS database so Chromium and Firefox trust it keploy#4958.remote error: tls: unknown certificatewent from 93 to 0 and from 18 to 0 once the lane installedlibnss3-tools.playwright-1.2.49has nocertutil(itslibnss3is2:3.110-1+deb13u4). This Dockerfile builds onnode-1.2.49. In the result,certutilcreates a database, adds a CA with trustC,,, lists it and removes it.libnss3-toolsdepends onlibnss3 (>= 2:3.101).Known limits