How to get HTTPS working on your local development environment in 5 minutes

How to get HTTPS working on your local development environment in 5 minutes
0

by Daksh Shah

Almost any website you visit today is protected by HTTPS. If yours isn’t yet, it should be. Securing your server with HTTPS also means that you can’t send requests to this server from one that isn’t protected by HTTPS. This poses a problem for developers who use a local development environment because all of them run on http://localhost out-of-the-box.


This is a companion discussion topic for the original entry at https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/

Hi,
Just wanted to say that this is by far the best step by step guide on creating a CA and keys which Chrome accepts.
I did this on Windows and it’s mostly the same except for the keychain which is certmgr.msc

For anyone developing an Android app you can also add the RootCA.pem in Settings > Tools > Server Certificates so that a generated apk can connect over https.
Of course you will also need to have created keys for a named instance so instead of localhost use the server name.

Once again, thanks so much for this!

1 Like

How to do this in Arch Linux?

This is no longer working in MacOS 10.14.5 . You can’t import the certificate, you get a nice cryptic “Error -25294”

However you can run this command to import the pem file, evidently this has been broken for years now… You still have to open the certificate and tell it to “Trust Always” for this to work

security import tmp/rootCA.pem -k ~/Library/Keychains/login.keychain

How to waste 5 minutes. Next time specify that its for MACs only