Created
April 20, 2021 11:46
-
-
Save jamietre/2238970da046ed5e04c1593e86c9c945 to your computer and use it in GitHub Desktop.
Import local issuer certificates to msys2
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
get-childitem -path cert:\LocalMachine\Root | ForEach-Object { | |
$hash = $_.GetCertHashString() | |
$base64certificate = @" | |
-----BEGIN CERTIFICATE----- | |
$([Convert]::ToBase64String($_.export('Cert'), [System.Base64FormattingOptions]::InsertLineBreaks)) | |
-----END CERTIFICATE----- | |
"@ | |
[System.IO.File]::AppendAllText("$home\windows.pem", $base64certificate) | |
} |
For node:
export NODE_EXTRA_CA_CERTS="C:\\msys64\\usr\\ssl\\certs\\ca-bundle.crt"
You may need echo -e
there to interpret the \n
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This solves the problem of msys2 not working with corporate VPN running.
Powershell script to pull certificates from windows store from: msys2/MSYS2-packages#296 (comment)
When it finishes, copy "windows.pem" to
/msys64/usr/ssl/certs/ca-bundle.crt
Script above fixes pacman. You also need to fix python. The same technique can be used, you can get the location of the py cert store within msys2: