Lcl.Host + Windows

Lcl.host + Windows = ❤️

Chris Stolt
Chris Stolt
May 30, 2024

At Anchor we strive to make encryption approachable, easy, and fun for ALL developers. In March we launched lcl.host, a free devtool to set up HTTPS in your local development environment. We started with MacOS and Linux support for our MVP and have been getting asked about adding Windows support ever since.

With nearly half of the world's developers using Windows the requests for Windows support came as no surprise. We can’t “make encryption approachable, easy, and fun for All developers” without meeting their encryption needs. 

Today we are happy to announce that lcl.host officially supports Windows. You can install via winget, and it is free to use.

Give it a try:

PS C:\Users\ankydotdev> winget install anchor PS C:\Users\ankydotdev> anchor trust

Run this from your project directory to get a HTTPS certificate for your application that works in your browser.

windows+lcl.host

Why lcl.host?

In previous posts we explored the benefits of using lcl.host to setup local development HTTPS encryption while building front end apps, to squash mixed content issues, and for various other reasons. Those points remain true whether developing on Windows, MacOS, or Linux. With the introduction of WSL (Windows Subsystem for Linux) local HTTPS is extra tricky on a typical Windows development environment in 2024.  

Let’s say you have a project called `myproj` that you run in WSL and test with your normal Windows browser. You want to serve requests over HTTPS with a certificate that works with your browser. Now things get tricky: WSL uses a different trust store than your Windows system, and both need to be updated to trust the development certificates. Most existing developer tooling only works in a single environment, so certificates that work in the WSL environment won’t work with your browser.

But fear not, setup with lcl.host is super easy and it synchronizes trust stores across your development environments.

Configure myproj from inside WSL

From inside your WSL project run:

$ brew install anchordotdev/tap/anchor $ anchor lcl

After finishing the command and following the setup guide instructions your app will automatically provision and renew certificates. When the app starts it will run HTTPS locally and requests from within WSL will be trusted. But there’s one more step to make the certificate work with your browsers outside WSL.

Configure Windows to trust the Anchor provided certificate

Next you just need to let Windows know that it can trust the certificate that myproj is presenting.

Run the following commands from outside WSL:

PS C:\Users\ankydotdev\source\repos\myproj> winget install anchor PS C:\Users\ankydotdev\source\repos\myproj> anchor trust

Now your Windows system will trust any web requests made to `myproj` from outside of WSL. 

That's it, a couple of simple commands get everything setup and configured. No need to try and copy files to all the right places or worry about keeping things in sync.

Try Now

Install the Anchor CLI, run` anchor lcl` from your application directory, and have local HTTPS in no time!