简体   繁体   English

通过Invoke-RestMethod测试dsc拉取服务器意外关闭

[英]Testing dsc pull server via Invoke-RestMethod unexpectedly closes

I am setting up a DSC HTTPS Pull Server and am testing the service. 我正在设置DSC HTTPS Pull服务器并正在测试服务。 In the browser I can access the service with the following URL 在浏览器中,我可以使用以下URL访问该服务

https://dsc.mydomain.com:8080/PSDSCPullServer.svc/$metadata

However the same URL using PowerShell fails. 但是,使用PowerShell的相同URL失败。 Why? 为什么?

Invoke-RestMethod -Uri https://dsc.mydomain.com:8080/PSDSCPullServer.svc/$metadata -Verbose

This is the error in PowerShell: 这是PowerShell中的错误:

Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Invoke-RestMethod -Uri https://dsc.mydomain.com:8080/PSDSCPullSe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

由于使用的是https,因此还必须使用签名证书,因此,除非这是$ metadata的一部分,否则可能是导致问题的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM