Firefox – Set Firefox to ignore certificates for localhost

firefoxssl-certificate

I have several (web) servers set up in various different locations I can SSH to, using port forwarding to work with them pointing my Firefox to https://localhost:443/application (I use ssh user@server -L 443:localhost:443 to connect).
Each server was set up with a different self-signed certificate (generated during server setup) which doesn't matter to me – there needs to be no real security involved. However depending on which server I'm connected to, my Firefox will always display a security warning after connecting to a different server. Sharing one certificate for all servers is not an option. Using different ports for each is also no option. Using http is no option as well.

Is there any way to tell Firefox to accept all certificates on localhost (and only on localhost!) without reconfirmation, even if they change?

Best Answer

No I don't think so. localhost isn't treated any differently to any other hostname. So you accept an exception for a specific circumstance: hostname+certificate.

If the certificate changes for a domainname, the exception no longer applies, and so you'll get prompted.

What you might want to consider is adding different host names to your /etc/hosts file:

127.0.0.1               localhost server1 server2 server3 server4

Then for each of the forwarded hosts, you would use https://server1 or https://server2 etc. These would still point to 127.0.0.1, but with a different hostname.

Then you could accept an exception for each one.