Skip to content

Commit

Permalink
Merge pull request #1567 from phillipsj/bugfix/windows-installation-s…
Browse files Browse the repository at this point in the history
…cripts

Fixing issues with windows installation scripts.
  • Loading branch information
phillipsj committed Aug 6, 2021
2 parents 989c1d4 + 7652848 commit 8d17937
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ switch ($Method) {
$temp = $env:TEMP
}

if (Test-Path $temp) {
Remove-Item -Path $temp -Force -Recurse
if (Test-Path "$temp/rke2-install") {
Remove-Item -Path "$temp/rke2-install" -Force -Recurse
}
New-Item -Path $temp -Name "rke2-install" -ItemType "Directory"

Expand Down
15 changes: 1 addition & 14 deletions windows/rke2-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -307,20 +307,7 @@ function Rke2-Installer
return
}

Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@

[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
Invoke-RestMethod -Uri $env:CATTLE_SERVER/$caCertsPath -OutFile $env:RANCHER_CERT
curl.exe --insecure -fL $env:CATTLE_SERVER/$caCertsPath -o $env:RANCHER_CERT
if (-Not(Test-Path -Path $env:RANCHER_CERT))
{
Write-Error "The environment variable CATTLE_CA_CHECKSUM is set but there is no CA certificate configured at $( $env:CATTLE_SERVER )/$( $caCertsPath )) "
Expand Down

0 comments on commit 8d17937

Please sign in to comment.