gpt4 book ai didi

Powershell 将安全协议(protocol)设置为 Tls 1.2

转载 作者:行者123 更新时间:2023-12-02 22:10:39 24 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Invoke-WebRequest SSL fails?

(4 个回答)


5年前关闭。




我正在使用此代码

        $WebClient = New-Object system.net.webclient
$WebClient.credentials = New-Object System.Net.NetworkCredential -ArgumentList $username, $password
$WebClient.Proxy = $null
$WebClient.Headers.Add("COperation","MethodCall")
$WebClient.Headers.Add("CMethod", "EnumerateInstances")
$WebClient.Headers.Add("CObject", $NameSpace)
$WebClient.Headers.Add("Content-Type", "application/xml")
$System= $WebClient.UploadString($Url, "POST", $EnumMessage)

这很好用。我想要做的是将安全协议(protocol)设置为 Tls1.2 或 Tls1.1。请帮忙。

最佳答案

设置这个应该改变协议(protocol):

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

PS:在powershell v5中检查

设置多个安全协议(protocol):
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12;

关于Powershell 将安全协议(protocol)设置为 Tls 1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41674518/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com