While troubleshooting why VS Code could no longer connect to PSU after upgrading from 4.3.4 to 5.0.5, due to what it was saying was an app token issue (Error 500), I deleted the existing app token and generated a new token.
Side issue: the little notification box that shows you what your new app token is doesn’t show any longer, so I had to disable Enhanced App Token Security in order to be able to use the Copy button next to the token.
Attempting to use this new token still resulted in VS Code saying it couldn’t connect, and gave an Error 500.
Switching over to the Swagger page, I entered the token at the top to authenticate, and then tried using some of the APIs to see if I could query anything. All of these resulted in Error 500’s as well.
This seems to confirm that App Tokens are not being stored in the DB properly, or something else is happening. Opening up the DB, with Enhanced App Token Security disabled, I can see the generated token, so it’s not an issue of storing the token in the DB. I’m not sure what’s going on yet.
Edit: Digging some more, and doing some more testing with Postman, I see that even with the following in my appsettings.json
file, gRPC is still throwing up error 500 responses.
"Api": {
"SecurityModel": "Permissive"
},
In Postman, I get:
Cannot retrieve the dynamic parameters for the cmdlet. Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.")
If I add -TrustCertificate
to the end of my Endpoint’s Invoke-PSUScript
line, the error changes to:
Cannot retrieve the dynamic parameters for the cmdlet. Status(StatusCode="Unknown", Detail="Bad gRPC response. HTTP status code: 500")
Product: PowerShell Universal
Version: 5.0.5