Play Button Pause Button

Setup HTTPS in Development With Create React App

maximization profile image Maxim Orlov ・1 min read

If you ever tried to make HTTPS work in development, you know it's something you can lose your head over 🤯.

How do you get that sweet green lock with Create React App ⚛ on localhost?

In this video, you'll learn how to setup HTTPS in development by creating your own SSL certificates and making sure the browser trusts them.

You only have to follow these steps once, and when you're done, you can reuse the SSL certificates throughout all of your projects.

📚 Links from video
mkcert - https://github.com/FiloSottile/mkcert

🎥 Watch more videos like this on my YouTube channel
👉🏼 https://www.youtube.com/channel/UCfxGdiOo8MthaZw4mFG0obA


Editor guide

Wow awesome that cover video saved me a lot of googling time.


Why would you do this? Every browser API that requires a secure context works on localhost even without setting up HTTPS on it.


Biggest reason I had for this was testing CORS configuration. Too many posts on SO show how to "enable all origins", but that's really not the point.


There are many problems that this video solves.
Sometimes you want to use a custom domain for localhost testing but you don't want to use 'localhost'. In that case the API simply doesn't work and service worker also stops.