So as the title says, I’m trying to connect to my PowerShell Universal IIS instance using the extension for Visual Studio Code and I get the following error:
The site is running on https, port 5000, with a server self signed certificate which I then imported to my machine.
Settings are as follows:
{
“name”: “Puniversal”,
“url”: “https://puniversal.devereandpartners.local:5000”,
“appToken”: “App Token Here”
}
I tried connecting to the server using invoke-request using the token and got:
Regarding the location of the certificate… well, I ended up putting it in both machine and user repos. Basically trying anything at this point. However I still find it strange that I can happily connect to the site using a browser and it won’t complain… but not with Visual Studio Code :-/
I can look into this. We aren’t doing anything too fancy with the extension. The axios package is just being used to query stuff in PSU so there must be some additional configuraition that needs to be done.
This is an old thread, but I have the exact same issue. Looking at the code you mentioned I see I can add the setting
allowInvalidCertificate to false that might disable rejectUnauthorized and allow for self sighed certs.
It does not. I have imported the certificate into the local machine Trusted Certification Authorities and still getting the ‘unable to verify first cretificate’ error. I can open PSU https url and see the cert now shows valid in the chrome browser.