Trust the devlanes CA
Follow these steps when a browser or a program on your machine rejects the certificate of a lane hostname.
Choose the stores
Section titled “Choose the stores”devlanes signs each certificate with the devlanes CA, a certificate authority devlanes creates on your machine. The setup command adds the CA to the stores your user config lists, and to the system store when it lists none.
macOS
The system store is your login keychain, which Safari, Chrome and Edge read, and Firefox with its default settings. Nothing to add.
Linux
Browsers on Linux keep stores of their own, so list them next to the system store. Both need the NSS tools, libnss3-tools on Debian and Ubuntu.
tls: trust: [system, chrome, firefox]tlsWhich certificate authority signs the proxy's HTTPS certificates (ca), and which stores devlanes setup installs it into (trust).
tls.trustStores devlanes setup installs the CA into and devlanes setup --remove removes it from; an empty list means [system]. On Linux, browsers do not read the system store, so add chrome and firefox there; inside WSL add windows for browsers on Windows. devlanes doctor shows each store's state.
Windows
The system store is your user’s store, which Chrome and Edge read, and Firefox with its default settings. Nothing to add.
tls.trust lists every store. Inside WSL the store to add is windows, as Run devlanes in WSL shows.
Add the CA
Section titled “Add the CA”Run the setup command in your own terminal, since your system asks for a password or a confirmation:
$ devlanes setupThen check that each store trusts the CA. The doctor prints a fix under any store that does not.
$ devlanes doctorGive your own commands the CA
Section titled “Give your own commands the CA”Node, Bun, Deno, Python, Rust, Go and Java services that devlanes starts already trust the CA. For commands you start yourself, open a shell with the same variables from the worktree:
$ devlanes env shellOr set them in your shell profile:
bash
export NODE_EXTRA_CA_CERTS="$HOME/.devlanes/ca/ca.pem"export DENO_CERT="$HOME/.devlanes/ca/ca.pem"export SSL_CERT_FILE="$HOME/.devlanes/ca/bundle.pem"export REQUESTS_CA_BUNDLE="$HOME/.devlanes/ca/bundle.pem"export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+$JAVA_TOOL_OPTIONS }-Djavax.net.ssl.trustStore=\"$HOME/.devlanes/ca/truststore.p12\" -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword=changeit"zsh
export NODE_EXTRA_CA_CERTS="$HOME/.devlanes/ca/ca.pem"export DENO_CERT="$HOME/.devlanes/ca/ca.pem"export SSL_CERT_FILE="$HOME/.devlanes/ca/bundle.pem"export REQUESTS_CA_BUNDLE="$HOME/.devlanes/ca/bundle.pem"export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+$JAVA_TOOL_OPTIONS }-Djavax.net.ssl.trustStore=\"$HOME/.devlanes/ca/truststore.p12\" -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword=changeit"PowerShell
$env:NODE_EXTRA_CA_CERTS = "$env:USERPROFILE\.devlanes\ca\ca.pem"$env:DENO_CERT = "$env:USERPROFILE\.devlanes\ca\ca.pem"$env:SSL_CERT_FILE = "$env:USERPROFILE\.devlanes\ca\bundle.pem"$env:REQUESTS_CA_BUNDLE = "$env:USERPROFILE\.devlanes\ca\bundle.pem"$env:JAVA_TOOL_OPTIONS = "$env:JAVA_TOOL_OPTIONS -Djavax.net.ssl.trustStore=`"$env:USERPROFILE\.devlanes\ca\truststore.p12`" -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword=changeit".Trim()bundle.pem holds the system’s root certificates plus the devlanes CA, and truststore.p12 holds the same certificates for Java. Every JVM prints a Picked up JAVA_TOOL_OPTIONS line when it starts. Go programs read SSL_CERT_FILE on Linux and the system store on macOS and Windows. The curl of macOS and Linux uses the system store and needs nothing.
Pass JVM flags without losing the CA
Section titled “Pass JVM flags without losing the CA”devlanes adds its trust store to JAVA_TOOL_OPTIONS after the value from your shell, mise or direnv. A JAVA_TOOL_OPTIONS in the project file’s env, global_env or a profile replaces it, and the start shows a note. Put JVM flags in the command itself, in -Dspring-boot.run.jvmArguments for spring-boot:run, or in MAVEN_OPTS or JAVA_OPTS where your build reads them.
A JAVA_TOOL_OPTIONS that sets javax.net.ssl.trustStore itself is kept as it is. Use that for a program that needs its own trust store, such as one that relies on roots someone imported into the JDK’s cacerts, which the devlanes trust store does not hold.
If curl.exe rejects the certificate on Windows
Section titled “If curl.exe rejects the certificate on Windows”curl.exe checks for a revocation list, which the devlanes CA does not publish. Add a flag that skips that check and still verifies the certificate:
$ curl.exe --ssl-revoke-best-effort https://myapp.localhost/If you already trust mkcert
Section titled “If you already trust mkcert”devlanes can sign with mkcert’s CA instead of its own, so browsers that trust mkcert need nothing new:
tls: ca: mkcerttlsWhich certificate authority signs the proxy's HTTPS certificates (ca), and which stores devlanes setup installs it into (trust).
tls.caWhich CA signs the certificate for each lane hostname; defaults to devlanes. Choose mkcert when your browsers already trust mkcert's CA.
$ devlanes daemon restartmkcert’s CA can sign any name, unlike the devlanes CA; Security has what that changes.