Search code examples
androidsslfirefoxmkcert

Android Firefox constantly prompting to Accept Risk for mkcert-created SSL certificate


In my dev laptop I installed an SSL cert using mkcert. Works fine in all desktop browsers. They don't even prompt to accept the "risk" and continue. But in my Android phone on the same LAN (with the dev subdomain in dns) I get that prompt from both Chrome and Firefox. That would be acceptable, except Firefox prompts pretty much every time I return focus to the app. It gets annoying having to click two extra buttons (Advanced then Accept Risk and Continue) for every code change that needs to be tested in all browsers.

Is there any way to make Android Firefox permanently accept the cert or any other solution?


Solution

  • Took a while, but I figured it out!

    First transfer copy of the rootCA.pem cert file from laptop to phone.

    File location found via CLI: mkcert -CAROOT

    Then install the cert file in Android settings, the location of which varies per device and Android version.

    In my phone it was in: Android Settings / General / Lock screen & security / Encryption & credentials / Install from storage

    You might have to restart the phone. Also might have to click TRUST on the cert in Android settings.

    Then enable Firefox secret settings by clicking multiple times on the Firefox logo in the About page, then in secret settings enable "Use third party CA certificates".

    Voila!