Created
February 24, 2020 17:10
-
-
Save jak119/bb98fe3d2beeb357f46c938c93cecc63 to your computer and use it in GitHub Desktop.
Copy Root Certs to Windows Git Cert File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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