Closed darylknight closed 2 years ago
@darylknight I see what the issue is an I will work on getting that into the next release... It appears we are not trimming the string correctly on the URL. If you remove the trailing 82 it should work. Can you verify it works when removing that and I will look at fixing it ASAP.
Thanks Jason - it looks like this command worked:
certutil -addstore -f "Root" \\wsl$\Ubuntu-20.04\home\darylknight\.nitro\nitro.crt
so also removing the <nil>
mentioned in the instructions
The confirmation I get is:
C:\Windows\system32>certutil -addstore -f "Root" \\wsl$\Ubuntu-20.04\home\darylknight\.nitro\nitro.crt
Root "Trusted Root Certification Authorities"
Signature matches Public Key
Certificate "Caddy Local Authority - 2022 ECC Root" added to store.
CertUtil: -addstore command completed successfully.
I assume it works now, but can't actually test it - running any of my sites in the browser at http://sitename.nitro (or https) is still showing me this:
I have no idea why that's happening, and was hoping it was the certificate step but looks like that wasn't the cause.
Problem solved. I just ran nitro apply
and saw this:
This step is not mentioned anywhere in the docs for running Nitro on Windows
@darylknight created a new issue to track that bug.
@mattstein maybe worth looking at the docs for Windows?
It is mentioned with an explanation of why it’s required:
The first time you add a Craft site, you’ll need to manually run a command on the Windows host machine to import a certificate file so SSL will work. You can follow the terminal output for exact instructions.
Nitro cannot edit the Windows hosts file at C:\Windows\system32\drivers\etc\hosts and will provide you with copy+paste instructions when it needs the file updated.
Will add an output example so it’s harder to miss and easier to search.
Ok - so it looks like there are two points where things have to be manually added on Windows:
The first time you add a Craft site, you’ll need to manually run a command on the Windows host machine to import a certificate file so SSL will work. You can follow the terminal output for exact instructions.
This works - Nitro tells you that you have to run the certutil
command, which is when I created this issue
Nitro cannot edit the Windows hosts file at C:\Windows\system32\drivers\etc\hosts and will provide you with copy+paste instructions when it needs the file updated.
The first time you add a site, Nitro doesn't tell you that you have to edit the hosts file. I only saw these copy/paste instructions when I ran nitro apply
for a different reason
I think that’s expected because of when Nitro gets to certain internal updates—but @jasonmccallister can correct me if I’m wrong.
I’ll add a tip to the docs since it’s kind of confusing / unexpected.
That is correct. Running nitro add
only updates the ~/.nitro/nitro.yaml
file. Nothing gets "applied" to Docker until nitro apply
is ran. It will look at the nitro.yaml
and add/remove containers based on whatever is in the configuration.
@darylknight in your terminal, can you provide the output of the following commands?
echo $WSL_DISTRO_NAME
echo $USER
I'm sorry, I don't have this all set up anymore. I was just playing around trying to get Nitro set up on Windows, but am back on Mac now.
Ok, no worries!
Description
Following the instructions here: https://craftcms.com/docs/nitro/2.x/windows.html#manually-trust-certificates-and-edit-the-hosts-file I ran
nitro trust
, and was told to enter this:I opened an Administrator Command Prompty and entered
certutil -addstore -f "Root" \\wsl$\Ubuntu-20.04\home\darylknight\.nitro\nitro.crt82 <nil>
and got this error:Additional info