gpt4 book ai didi

powershell - 如何在 powershell 中为简单的 https 下载设置默认的 Default SSLContext?

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

本期来自应征http://www.foundweekends.org/conscript/setup.html当我尝试通过运行官方脚本 (setup.ps1 script source code) 在我的 Windows 10 上安装 conscript 时,我遇到了其他问题:

 :::: ERRORS
Server access Error: java.security.NoSuchAlgorithmException: Default SSLContext not available url=https://dl.bintray.com/foundweekends/maven-releases/org/foundweekends/conscript/conscript_2.11/0.5.0/conscript_2.11-0.5.0.pom

Server access Error: java.security.NoSuchAlgorithmException: Default SSLContext not available url=https://dl.bintray.com/foundweekends/maven-releases/org/foundweekends/conscript/conscript_2.11/0.5.0/conscript_2.11-0.5.0.jar

Server access Error: java.security.NoSuchAlgorithmException: Default SSLContext not available url=https://oss.sonatype.org/content/repositories/releases/org/foundweekends/conscript/conscript_2.11/0.5.0/conscript_2.11-0.5.0.pom

Server access Error: java.security.NoSuchAlgorithmException: Default SSLContext not available url=https://oss.sonatype.org/content/repositories/releases/org/foundweekends/conscript/conscript_2.11/0.5.0/conscript_2.11-0.5.0.jar

Server access Error: java.security.NoSuchAlgorithmException: Default SSLContext not available url=https://repo1.maven.org/maven2/org/foundweekends/conscript/conscript_2.11/0.5.0/conscript_2.11-0.5.0.pom

Server access Error: java.security.NoSuchAlgorithmException: Default SSLContext not available url=https://repo1.maven.org/maven2/org/foundweekends/conscript/conscript_2.11/0.5.0/conscript_2.11-0.5.0.jar

我认为问题来自:

$wc = New-Object System.Net.WebClient
...
$wc.DownloadFile($url, "$CS/$LJ")

这里有wc对象,但是没有为下载对象组装SSLContext。

你能给我举例说明如何给 $wc 默认 SSLContext 并让它下载 https 链接吗?

最佳答案

试着把它放在脚本的顶部

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

关于powershell - 如何在 powershell 中为简单的 https 下载设置默认的 Default SSLContext?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38733742/

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