Localcert combines a custom DNS server with Let's Encrypt to make local development with a valid TLS certificate quick and easy.
Localcert is a normal Go CLI tool. It can be installed with a working Go developer env with:
go install github.com/wildone/localcert/cmd/localcert@latest
You can also download a release binary.
localcert
This will provision a domain and wildcard certificate like *.fsbli4oliukyh3ydjuzx7q2tdq.user.localcert.dev
for your use. The Localcert DNS server will respond to certain subdomains of your domain:
localhost.<your subdomain>.user.localcert.dev
->127.0.0.1
ip10-11-12-13.<your subdomain>.user.localcert.dev
->10.11.12.13
- This form supports IPs in the following reserved address blocks:
10.0.0.0/8
,172.16.0.0/12
,192.168.0.0/16
(private networks)169.254.0.0/16
(link-local addresses)127.0.0.0/8
(loopback addresses)
- This form supports IPs in the following reserved address blocks:
Usage of C:\projects\github\localcert\bin\localcert.exe:
-acceptTerms
accept ACME provider's terms of service
-acmeAccount string
path to ACME account file
-acmeUrl string
ACME directory URL
-dataDir string
default data directory
-forceRenew
force renewel of certificate with > 30 days until expiration
-localCert string
path to localcert certificate
-localKey string
path to localcert certificate key
-serverUrl string
localcert server URL (default "https://api.localcert.dev")
-testPort int
port for test server (default 8443)
Found existing certificate for domain "*.wxsm3zde4rwj2j2eimuhfwpgni.user.localcert.dev"
Existing certificate expires in > 30 days and doesn't need to be renewed
Certificate expires 2023-08-24 00:33:15 +0000 UTC
Certificate (chain): C:\projects\github\localcert\\data\\cert.pem
Certificate privkey: C:\projects\github\localcert\\data\\key.pem
Found existing certificate for domain "*.wxsm3zde4rwj2j2eimuhfwpgni.user.localcert.dev"
Provisioning domain "*.wxsm3zde4rwj2j2eimuhfwpgni.user.localcert.dev"...
Certificate expires 2023-08-24 00:33:15 +0000 UTC
Certificate (chain): C:\projects\github\localcert\\data\\cert.pem
Certificate privkey: C:\projects\github\localcert\\data\\key.pem
Provisioning domain "*.j6liixjthh7wfankaazyq3f36m.user.localcert.dev"...
Domain provisioned; waiting for certificate generation...
Certificate expires 2023-08-26 04:52:14 +0000 UTC
Certificate (chain): C:\projects\github\localcert\\data\\cert.pem
Certificate privkey: C:\projects\github\localcert\\data\\key.pem