Can I Get Letsencrypt Certificate for Local Development
Right Now I'm Using Self-Signed Https Certificates for Local Development and Letsencrypt Certificates in Production. Is It Possible to Use Letsencrypt...
Right now I'm using self-signed HTTPS certificates for local development and Letsencrypt certificates in production. Is it possible to use Letsencrypt certificates for local development as well? For domains like local.mydomain.com?
I think it's not possible because my local website is not publicly accessible from the outside and therefore Letsencrypt cannot do ACME challenge.
So is there a way to get Letsencrypt certificates locally, or it's not intended to work like that and I should stick with self-signed certificates?
1 Answer
Yes!
You absolutely can!
Let’s Encrypt is not only intended for local development certificates, but also many IoT and on-prem Enterprise solutions that are on private networks, unreachable using the HTTP-01 in production as well.
TXT records: DNS-01 challenge
There are three ways to validate a domain:
- HTTP-01 over plain HTTP on port 80
- TLS-ALPN-01 over TLS v1.2+ on port 443
- DNS-01 over UDP/TCP on port 53
For the DNS challenge you can either manually set a DNS record every so often, or use an automated plugin built specifically for your DNS provider.
Greenlock - a client for all ENVs
I’m the author of Greenlock, which is similar to certbot, but written in plain JavaScript and more geared towards those three use cases I mentioned before:
- local development
- IoT
- Enterprise On-Prem
Try it in your Browser:
Since it’s written in JavaScript, you can try it out right in your web browser, using the manual method: