Windows 10更新后VB Shell执行curl无法生成输出文件问题
Windows 10更新后VBS中Curl命令无法生成输出文件问题
更新前正常运行状态
Windows 10更新前,我通过以下方式构造Curl命令:curlcommand = ocurlMain & content & oAuth & " " & oTarg & Outfile其中
Outfile为"-o filename",执行result = Shell(curlcommand, vbMaximizedFocus)后,Curl命令可正常执行,并在本地生成指定输出文件。更新后的异常现象
系统更新后,因认证问题我在ocurlMain中添加了-k参数。此时Curl命令虽能触发执行,但无法生成输出文件;但直接在命令提示符中运行相同命令,却能正常执行并生成文件。我尝试了Shell所有Focus选项,均无法解决该问题。补充信息
无论在VBS脚本还是终端执行命令,都会出现SSL证书错误:curl: (60) SSL certificate problem: unable to get local issuer certificate。我推测修复SSL证书问题并移除-k参数,可能能解决VBS中Shell调用Curl无法生成输出文件的问题。命令构造详情
命令各组成部分:curlcommand = ocurlMain & content & oAuth & " " & oTarg & Outfile where ocurlMain = " curl -H " content = ""Content-Type: application/json" -H " oAuth = "Authorization: Bearer "32 byte personal API Key"" oTarg = "https://api-fxtrade.oanda.com/v3/accounts/"personal account number"""实际执行的完整Curl命令:
curl -H "Content-Type: application/json" -H "Authorization: Bearer 32byte personal API key" "https://api-fxpractice.oanda.com/v3/accounts/"personal account number""
内容的提问来源于stack exchange,提问作者George Archer
相关产品推荐
相关产品推荐

