Skip to content

Instantly share code, notes, and snippets.

@iversond
Created March 26, 2018 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iversond/772e73257c4ca59a9e6137baa7288788 to your computer and use it in GitHub Desktop.
Save iversond/772e73257c4ca59a9e6137baa7288788 to your computer and use it in GitHub Desktop.
Script to download the updated CA file to RubyGems on Windows will work. From the blog post: http://wragg.io/using-puppet-modules-forge-and-r10k/
$CACertFile = Join-Path -Path $ENV:AppData -ChildPath 'RubyCACert.pem'
If (-Not (Test-Path -Path $CACertFile)) {
"Downloading CA Cert bundle.."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri 'https://curl.haxx.se/ca/cacert.pem' -UseBasicParsing -OutFile $CACertFile | Out-Null
}
"Setting CA Certificate store set to $CACertFile.."
$ENV:SSL_CERT_FILE = $CACertFile
[System.Environment]::SetEnvironmentVariable('SSL_CERT_FILE',$CACertFile, [System.EnvironmentVariableTarget]::Machine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment