Skip to content

Instantly share code, notes, and snippets.

@jak119
Created February 24, 2020 17:10
Show Gist options
  • Save jak119/bb98fe3d2beeb357f46c938c93cecc63 to your computer and use it in GitHub Desktop.
Save jak119/bb98fe3d2beeb357f46c938c93cecc63 to your computer and use it in GitHub Desktop.
Copy Root Certs to Windows Git Cert File
$Path = ($env:ProgramFiles + "\Git\mingw64\ssl\certs\ca-bundle.crt")
# Make a backup
Copy-Item $Path ($Path + ".old") -Force
$certs = Get-Childitem cert:\LocalMachine\root -Recurse
foreach ($cert in $certs) {
Add-Content $Path "-----BEGIN CERTIFICATE-----"
Add-Content $Path -Value ([convert]::tobase64string((get-item $cert.PSPath).RawData)) -Encoding Ascii
Add-Content $Path "-----END CERTIFICATE-----"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment