How do I get my Edge web browser to trust my local development Symfony website running in WSL?

I am coding a website on Windows 10 using WSL 1 (Windows Subsystem for Linux) with Ubuntu 18.04 LTS. I am using Symfony local web server. I would like to use https, testing the website at the URL https://localhost:8000 But web browsers say the website is not trusted. Edge (Chromium-based) shows a web page with these errors:

    Your connection isn't private
    Attackers might be trying to steal your information from localhost
    (for example, passwords, messages, or credit cards).

Examining the certificate shows the error: This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store.

How do I prevent these errors?


When you install the symfony command in WSL, the instructions say to run the command symfony server:ca:install. This creates some self-signed certificate files in ~/.symfony/certs/ The Windows 10 processes such as Edge need to be told about this certificate using the following procedure.

Copy ~/.symfony/certs/rootCA.pem to your Windows 10 Documents directory.
In Windows 10, search for "mmc" and run the Microsoft Management Console command.
Select File > Add Snap-in "Certificates" for current user.
Expand "Certificates - Current User"
Expand Trusted Root Certification Authorities
Click Certificates folder
Select Action > All Tasks > Import...
In the File chooser popup, select file filter All Files (*.*) and choose rootCA.pem
You will be prompted with a security warning. Verify the cert listed is the self-signed cert and click yes
(You may need to restart your browser or computer.)

This answer was adapted from here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.