gpt4 book ai didi

Powershell Invoke-Restmethod 由于 SSL/TLS 安全通道 (Smartsheets API) 而中止

转载 作者:太空宇宙 更新时间:2023-11-03 13:46:12 25 4
gpt4 key购买 nike

我在使用 powershell Invoke-Restmethod cmdlet 调用 smartsheets api 时遇到问题。附加的脚本以前工作过。请参阅下面有关 SSL/TLS 的错误消息。

$apiKey = "**********"
$url = "https://api.smartsheet.com/2.0/sheets"
$get_headers = @{"Authorization" = "Bearer " + $apiKey}
$put_headers = @{}
$put_headers.Add("Authorization", "Bearer " + $apiKey)
$put_headers.Add("Content-Type", "application/json")

$response = Invoke-RestMethod -Uri $url -Headers $get_headers

Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure
channel.

这个错误到底有没有?

最佳答案

Smartsheet API 放弃了对 TLS 1.0 的支持,这是 Powershell 的默认设置。

link Palansen shared上面有一些很好的解决方案。基本上,您需要告诉 Powershell 在调用时使用 TLS 1.2。

关于Powershell Invoke-Restmethod 由于 SSL/TLS 安全通道 (Smartsheets API) 而中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53675581/

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