DEV Community

Play Button Pause Button
Maxim Orlov
Maxim Orlov

Posted on • Updated on • Originally published at youtube.com

Setup HTTPS in Development With Create React App

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 one on my YouTube channel 🎥

Discussion (5)

Collapse
thpthangnextfunc profile image
Thang Tran

Thank you. Can you create a video: "How to deploy react native app on Google Cloud and point a domain from GoDaddy to that IP" (https secure). I used nginx but it took port 80, someone says let's take nginx as reverse proxy?!

Collapse
andrewbaisden profile image
Andrew Baisden

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

Collapse
robbiegm profile image
RobbieGM

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

Collapse
doug profile image
Doug

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.

Collapse
haloboy777 profile image
Ayush Singh

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.