From 005850e5c4359ea4d13f0595b79b365640fad794 Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Mon, 22 Apr 2024 18:09:53 -0300 Subject: [PATCH] try installing in NSS shared DB --- .github/workflows/test-browser.yml | 6 ++++++ test/support/playwrightHelpers.js | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-browser.yml b/.github/workflows/test-browser.yml index 3e864b5dc..00cd9f812 100644 --- a/.github/workflows/test-browser.yml +++ b/.github/workflows/test-browser.yml @@ -58,6 +58,12 @@ jobs: - name: Install NSS tools run: sudo apt install libnss3-tools + # This works for Chromium (see https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md) + # Note this is the same command that we use for adding it to the Firefox profile (see playwrightHelpers.js) + # TODO does it work for WebKit? + - name: Install mitmproxy root CA in NSS shared DB + run: certutil -A -d sql:$HOME/.pki/nssdb -t C -n "Mitmproxy Root Cert" -i ~/.mitmproxy/mitmproxy-ca-cert.pem + - name: Run the tests env: PLAYWRIGHT_BROWSER: ${{ matrix.browser }} diff --git a/test/support/playwrightHelpers.js b/test/support/playwrightHelpers.js index b7d5538e3..8737b2db2 100644 --- a/test/support/playwrightHelpers.js +++ b/test/support/playwrightHelpers.js @@ -37,10 +37,10 @@ async function openPlaywrightBrowser(headless) { `certutil -A -d ${profileDirectory} -t C -n "Mitmproxy Root Cert" -i ~/.mitmproxy/mitmproxy-ca-cert.pem`, ); break; - default: - // TODO chromium, webkit - // Bear in mind that on a developer’s machine we don’t really want to install any root CA certs that will have a global effect; keep it localised to the - throw new Error(`Don’t yet know how to install root CA cert for browser ${browserEnv}`); + //default: + //// TODO chromium, webkit + //// Bear in mind that on a developer’s machine we don’t really want to install any root CA certs that will have a global effect; keep it localised to the + //throw new Error(`Don’t yet know how to install root CA cert for browser ${browserEnv}`); } const options = {