首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Invoke-RestMethod :基础连接已关闭:发送时发生意外错误。--詹金斯

Invoke-RestMethod :基础连接已关闭:发送时发生意外错误。--詹金斯
EN

Stack Overflow用户
提问于 2020-01-29 21:47:33
回答 1查看 1.2K关注 0票数 0

您好,当我尝试运行以下命令时,我的jenkins通过pshell调用命令出现了问题:

代码语言:javascript
代码运行次数:0
运行
复制
$restoreSecProto = [Net.ServicePointManager]::SecurityProtocol
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$base64 = [System.Convert]::ToBase64String(([System.Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $cred.Username, $cred.GetNetworkCredential().Password))))
$basicAuthValue = "Basic $base64"
$headers = @{ 'Authorization' = $basicAuthValue }

$crumb = Invoke-RestMethod -Headers $headers -Uri 'https://localhost:8443/crumbIssuer/api/xml?xpath=//crumb' -SessionVariable session -UseBasicParsing 
$session
$headers.Add('Jenkins-Crumb', $crumb.crumb) 

错误: Invoke-RestMethod :基础连接已关闭:发送时发生意外错误。

请注意,CSRF已启用

感谢你的帮助

EN

回答 1

Stack Overflow用户

发布于 2020-01-29 22:01:13

看起来好像ISE会话被窃听了。:S

它在我重新启动ISE后工作

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59968463

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档