【问题标题】:Powershell Invoke-Restmethod aborted due to SSL/TLS Secure Channel (Smartsheets API)Powershell Invoke-Restmethod 由于 SSL/TLS 安全通道(Smartsheets API)而中止
【发布时间】:2019-05-09 13:51:11
【问题描述】:

我无法使用 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.

这个错误有什么问题吗?

【问题讨论】:

标签: powershell ssl smartsheet-api


【解决方案1】:

Smartsheet API 不再支持 TLS 1.0,这是 Powershell 的默认设置。

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

【讨论】:

    猜你喜欢
    • 2017-05-27
    • 2020-11-06
    • 2019-06-17
    • 2019-08-12
    • 1970-01-01
    • 2015-02-04
    • 2018-02-21
    相关资源
    最近更新 更多