So I have never needed to use this cmdlet before now, but now I need to set up a PSU endpoint which invokes a script. Every time I attempt to invoke the script with a simple cmdlet usage like:
{
"message": "Failed: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.\r\n ---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.\r\n at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)\r\n at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)\r\n at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)\r\n --- End of inner exception stack trace ---\r\n at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType) in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 531\r\n at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType) in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 537\r\n at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType) in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 537\r\n at PowerShellUniversal.GrpcCommand.GetService[T]() in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 568\r\n at UniversalAutomation.GetScriptCommand.EndProcessing() in D:\\a\\universal\\universal\\src\\Cmdlets\\Automation\\GetScriptCommand.cs:line 39\r\n at System.Management.Automation.Cmdlet.DoEndProcessing()\r\n at System.Management.Automation.CommandProcessorBase.Complete()"
}
Obviously I can tell there is some sort of SSL issue here, but the documentation isn’t clear to me what the requirements actually are. Am I supposed to use an app token? I have valid SSL certs, so I’m really confused about this.
Hi,
try use the parameter -TrustCertificate while using Get-PSUScript.
If there is still an error you probably need to connect to the psu server itself:
Thanks for the reply! Unfortunately I have already tried that too, which results with this error:
"message": "Failed to execute Offboarding Main script: Grpc.Core.RpcException: Status(StatusCode=\"Unknown\", Detail=\"Bad gRPC response. HTTP status code: 500\")\r\n at ProtoBuf.Grpc.Internal.Reshape.UnaryTaskAsyncImpl[TRequest,TResponse](AsyncUnaryCall`1 call, MetadataContext metadata, CancellationToken cancellationToken) in /_/src/protobuf-net.Grpc/Internal/Reshape.cs:line 554\r\n at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)\r\n at Nito.AsyncEx.AsyncContext.<>c__DisplayClass16_0`1.<Run>b__0(Task`1 t)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)\r\n at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)\r\n at PowerShellUniversal.ValueTaskExtensions.ToResult[T](ValueTask`1 valueTask) in D:\\a\\universal\\universal\\src\\PowerShellUniversal\\ValueTaskExtensions.cs:line 73\r\n at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType) in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 492\r\n at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType) in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 537\r\n at PowerShellUniversal.GrpcCommand.Connect[T](ConnectionType connectionType) in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 537\r\n at PowerShellUniversal.GrpcCommand.GetService[T]() in D:\\a\\universal\\universal\\src\\Cmdlets\\Transports\\GrpcCommand.cs:line 568\r\n at UniversalAutomation.GetScriptCommand.EndProcessing() in D:\\a\\universal\\universal\\src\\Cmdlets\\Automation\\GetScriptCommand.cs:line 39\r\n at System.Management.Automation.Cmdlet.DoEndProcessing()\r\n at System.Management.Automation.CommandProcessorBase.Complete()"
I was wondering about that, and I was trying to recall where to find the security mode setting. Is that in the appsettings.json? Docs aren’t very clear to me
EDIT: Nevermind, once again I find what I am looking for only after I spent hours looking yesterday.
To be fair, the search box at the top only goes by indexed words on the pages, that article has ‘SecurityModel’ but doesnt have ‘Security Mode’ which is what I think most people would search for in this case. It also doesnt seem to index the codeblocks, so if you search permissive it doesnt come up under that either.