How to add a root ca to snap installation of Brave on Ubuntu 22.10?

Context

After creating a self-signed root ca named ca.crt, I was trying to add it to the browser (using bash/CLI). However, I experienced some difficulties doing so.

Policies.json

For Firefox I was able to create the following policies.json file:

{
  "policies": {
    "Certificates": {
      "Install": [
        "/usr/local/share/ca-certificates/ca.crt"
      ]
    }
  }
}

and place it in:

/etc/firefox/policies/policies.json

such that Firefox automatically loads the ca.crt from the specified location. However, Brave does not recognise my policies.json file, because I do not know where to put it.

Ubuntu Trust Store

I have also added the root ca named ca.crt to the Ubuntu trust store, which is verified using:

cat /etc/ssl/certs/ca-certificates.crt

However, snap brave does not seem to load the root ca certificates from the Ubuntu Trust Store (because I do not see the new self-signed root ca in the Brave root certificates).

Question

How can one add a root ca named ca.crt to a snap installation of brave (using bash)?

Note

I am aware that one can manually the root ca to brave via the brave://settings/certificates settings>import. However, I aim to automate it (without a boilerplate browser controller).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.