Is it possible to make Firefox trust a selfsigned certificate?

I’m developing a full stack webapp with Vue and Node+Express, both are running in their own local https servers (I need https cause I want to set cookies), because of this I had to implement a self-signed certificate on the server but Firefox doesn’t trust in it, I know this is expected but is there a way to make Firefox to trust in it?

Currently I manage to import my certificate on the Your Certificates tab and also in the Authorities tab, but Firefox still doesn’t trust in it.

The way I generate the certificate was:

  1. I use this openssl config file (called req.cnf):
    [req]
    distinguished_name = req_distinguished_name
    x509_extensions = v3_req
    prompt = no
    [req_distinguished_name]
    CN = www.localhost.com
    [v3_req]
    keyUsage = critical, digitalSignature, keyAgreement
    extendedKeyUsage = serverAuth
    subjectAltName = @alt_names
    [alt_names]
    DNS.1 = www.localhost.com
    DNS.2 = localhost.com
    DNS.3 = localhost

  2. Then I ran this command in the same place the config file is:
    openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf -sha256

I reach to this through a lot of googling and reading but it didn’t doesn’t work, is it even possible?