This process creates SSL certificates and “trusts” them to go to a fake domain in your browser with the same name as the folder containing the certificates. Typically you generate them in the root of your project directory. So if you have a project in a directory, “my-excellent-project”, your SSL certificates would be valid for https://my-excellent-project.dev:PORT/, any subdomain. Do not commit them to source control (git).
- Open Terminal and run the following:
Install & Configure DNSMasq
- From Terminal, run the following (from https://github.com/wingsuitist/brewamp/blob/master/src/dnsmasq.sh):
Generate the SSL Certificate
- Open Terminal and cd into the root folder of your project.
- Create a temporary configuration file:
- Create the certificate:
- if you get the error “unable to write to random state”, do
and create the certificate again.
- Remove the configuration file:
- Open the SSL certificate in your keychain:
- Select the newly imported certificate, which should appear at the bottom of the certificate list, right click, and select “Get Info”.
- In the popup window, click the ▶ button to the left of Trust, and select Always Trust for When using this certificate:.
- Close the popup window.
- When prompted, enter your password again and click Update Settings.
- Close Keychain Access.