当我尝试在 https 上使用 Invoke-WebRequest 时,出现了一些奇怪的错误:
“Invoke-WebRequest:底层连接已关闭:无法为 SSL/TLS 安全通道建立信任关系。”
这是我的代码:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls
$url = "https://X.X.X.X:4343/officescan/console/html/cgi/cgiChkMasterPwd.exe"
$r = Invoke-WebRequest $url -SessionVariable office
Run Code Online (Sandbox Code Playgroud)
对我有什么建议吗??非常感谢。