Make Windows trust the Symfony CLI’s https running in WSL2
When you enable HTTPS in Symfony’s CLI inside WSL2, everything inside GNU/Linux works beautifully: browsers running in WSL2 trust the local CA, Symfony serves valid certificates, and your development environment feels clean. But the moment you open the same https://localhost URL in a Windows browser, the illusion breaks. Chrome, Edge, and Firefox on Windows all throw certificate warnings, insisting the connection is insecure — even though Symfony is generating certificates correctly. Solving this is not only a matter of development hygiene, but quite often by default many tools or frameworks require the API to be served using (theoretically) secure connection which results in us applying gimmicks and hacks to overcome the problem.
This happens because WSL2 is not the same machine as Windows, at least not from the perspective of trust stores and cryptographic identity. Microsoft has done an impressive job making WSL2 feel native: the filesystem is integrated, networking is seamless, and localhost forwarding “just works.” But beneath that convenience, WSL2 is still a lightweight virtual machine with its own OS, its own hostname, and — crucially — its own certificate authority store.
Windows maintains its own trusted root store, and Ubuntu (or any other Linux distribution running in WSL2) maintains a completely separate one. So when Symfony CLI generates a local CA and installs it into Linux’s trust store, Windows has no idea it exists. As far as Windows is concerned, your Symfony‑generated certificates are signed by an unknown authority, so it refuses to trust them.
This mismatch between trust stores is the root of the problem — and the reason your HTTPS dev environment looks secure in WSL2 but insecure in Windows.
This short explains how to make your Windows trust your locally generated CA inside WSL2.
Step 1: Install Symfony’s Local CA Inside WSL2
The first step is straightforward: you need Symfony CLI to generate and install its local Certificate Authority inside your WSL2 Linux environment. This ensures that Linux trusts the certificates Symfony generates for your development domains.
Run this inside your WSL2 terminal:
symfony server:ca:installYou should see in response:
[OK] The local Certificate Authority is installed and trustedNote: you may be asked to add your root password depending on your configuration.
Right… but we are still in the same situation: we have a CA trusted inside WSL2:
Yet Windows shows the connection as insecure:
Step 2: Make Windows Trust Symfony’s CA
At this point, Symfony CLI has created a local Certificate Authority inside WSL2 — but Windows still doesn’t know anything about it. To make Windows trust the HTTPS certificates generated by Symfony, you need to export the CA from WSL2 and import it into the Windows certificate store.
1. Locate Symfony’s CA inside WSL2
Symfony stores its CA certificate already in a Windows-compatible format in your GNU/Linux home directory, depending on the version of Symfony it may be:
~/.symfony5/certs/default.p12~/.config/symfony-cli/certs/default.p122. Navigate with your Windows Explorer
Navigate to the folder with the certificate file using your Windows Explorer, the path is (replace LINUX_USERNAME with your username inside WSL2):
\\wsl.localhost\Ubuntu\home\<LINUX_USERNAME>\.config\symfony-cli\certs3. Import the certificate
Double-click on the file name “default” (or default.p12 if you have showing of extensions enabled).
System will ask you where to install the certificate: user’s store or machine’s. Select Local Machine. On your machine it will of course display in your language, Polish in my case, yet the screen is simple enough to understand the analogies:
Click Next and confirm the path:
When asked about password for the private key leave everything as selected by default:
Now, the system will ask you where to install the certificate:
Click Browse… and select: Trusted Root Certification Authorities
Press OK and Finish on the next screen:
If everything went fine you should see an information about successful installation:
4. Test in your browser
Start symfony server in your project’s root folder:
symfony serveand open the URL as instructed by Symfony CLI:
in your browser:
Connection is now SECURE.
Important: it may be required to restart your browser first.
Thank you
I hope this short article helped you make Symfony’s HTTPS setup behave nicely across both WSL2 and Windows. I’m always trying to improve the clarity and usefulness of what I write, and one thing I’m working on is providing screenshots in English instead of Polish so they’re easier for everyone to follow. Still, I think it’s worth celebrating our differences — our languages, our tools, our workflows. They’re part of what makes our global developer community such an interesting place. Thanks for reading, and see you in the next article.
