This worked for me on Firefox 97.3.0:
- Install the self-signed CA certificate into Android (for me, this was under Settings -> Biometrics and security -> Other security settings -> User certificatesInstall from device storage -> CA certificate). My certificate had to be DER format.
- Open up Firefox Settings -> About Firefox
- Click on the logo 5 times (until "Debug menu enabled" popup appears)
- Go back to Settings - there should be a "Secret Settings" option now. Choose that.
- Enable "Use third party CA certificates"