DEV Community

Discussion on: Running SSL on localhost

Collapse
 
daniel15 profile image
Daniel Lo Nigro

Note that ngrok goes over the internet, so it's pretty excessive/slow for local development. The request will go over the internet to ngrok's servers, then back to your system.

What I usually do for local development is configure localdev.example.com (where example.com is the site for whatever project I'm working on) to resolve to 127.0.0.1 on my DNS server, and then use Let's Encrypt to create a real cert for localdev.example.com.

Collapse
 
electrode profile image
Electrode Cathode

I'm so interested to learn more about this.

Collapse
 
daniel15 profile image
Daniel Lo Nigro

You can use Let's Encrypt DNS validation to get certificates for servers even if they're not accessible over the internet (for example, for internal servers or local development). Certbot and acme.sh both support this and integrate with various DNS APIs to handle the validation, or you could manually set the required TXT record.

I use acme-dns to handle the validation, but it takes a bit of setup.