mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
install root ca
This commit is contained in:
@@ -110,6 +110,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Update-DotnetTLS.ps1"
|
"{{ template_dir }}/scripts/Installers/Update-DotnetTLS.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-RootCA.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "windows-restart",
|
"type": "windows-restart",
|
||||||
"restart_timeout": "10m"
|
"restart_timeout": "10m"
|
||||||
|
|||||||
24
images/win/scripts/Installers/Install-RootCA.ps1
Normal file
24
images/win/scripts/Installers/Install-RootCA.ps1
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Serialized Certificate Store File
|
||||||
|
$sstFile = "$env:TEMP\roots.sst"
|
||||||
|
# Generate SST from Windows Update
|
||||||
|
$result = certutil.exe -generateSSTFromWU $sstFile
|
||||||
|
if ($LASTEXITCODE -eq 0) {
|
||||||
|
# Dump certificates
|
||||||
|
$result = certutil.exe -dump $sstFile
|
||||||
|
if ($LASTEXITCODE -eq 0) {
|
||||||
|
# Import Root CA into "Trusted Root Certification Authority"
|
||||||
|
try {
|
||||||
|
Import-Certificate -FilePath $sstFile -CertStoreLocation Cert:\LocalMachine\Root
|
||||||
|
} catch {
|
||||||
|
Write-Host "[Error]: failed to import ROOT CA`n$_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "[Error]: failed to dump $sstFile sst file`n$result"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "[Error]: failed to generate $sstFile sst file`n$result"
|
||||||
|
}
|
||||||
|
|
||||||
|
exit $LASTEXITCODE
|
||||||
Reference in New Issue
Block a user