How to generate TLS certificates for testing purposes on your local machine

Whenever I do web development for myself, I like to make TLS certificates for local testing purposes. I wrote an OpenSSL-based software system that you can download from Github to make local testing certificates yourself. It includes a script and some preconfigured configuration files that you can use to generate certificates.

The software is located on Github under the generate_certificates project.

To run it, first install Go, NodeJS and OpenSSL. Then, run "go run generate_certificates.go " and follow the instructions in the README.md file. That should generate all the files you need for the certificates. You will need to trust the root certificate, enable enterprise security on your browser and add the domain you want to test locally to the /etc/hosts file.

Fuller instructions are available on the Github page.

November 23, 2023