2016-08-03 41 views
0

這從徵兵http://www.foundweekends.org/conscript/setup.html 當我嘗試通過運行該腳本官方在我的Windows 10安裝徵兵(setup.ps1 script source code)的問題,我遇見了問題:如何在PowerShell中爲簡單的https下載設置默認默認SSLContext?

:::: 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 defalult SSLContext並且可以讓它下載https鏈接?

+0

你'java.security'錯誤不是從PowerShell的到來,並沒有關於Java/JVM上運行,也可以使用Java庫的頂部。下載'「https://oss.sonatype.org/content/repositories/public/org/scala-sbt/launcher/1.0.0/launcher-1.0.0.jar」'的腳本中的WebClient行工作正常我的Windows 10安裝PowerShell。我認爲更有可能的是,您的Java安裝未針對較新的SSL站點進行配置,可能 - 這些站點已配置爲[高SSL安全設置](https://www.ssllabs.com/ssltest/analyze.html?d=oss .sonatype.org&s = 52.22.249.229&latest) – TessellatingHeckler

回答

0

嘗試把這個在你的腳本

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

這是沒用的,我已經這麼做了。 – user504909