I have created a self-signed SSL certificate for the localhost CN. Firefox accepts this certificate after initially complaining about it, as expected. Chrome and IE, however
Filippo Valsorda wrote a cross-platform tool, mkcert, to do this for lots of trust stores. I presume he wrote it for the same reason that there are so many answers to this question: it is a pain to do the "right" thing for SubjectAltName
certificates signed by a trusted root CA.
mkcert
is included in the major package management systems for Windows, macOS, and several Linux flavors. It is also mentioned in the Chromium docs in Step 4 of Testing Powerful Features.
mkcert
mkcert
is a simple tool for making locally-trusted development certificates. It requires no configuration.$ mkcert -install Created a new local CA at "/Users/filippo/Library/Application Support/mkcert"