From 25ed4c48ce74edc5b39767ff3ff97490e721b404 Mon Sep 17 00:00:00 2001 From: Misha Zharov <8266317+mishazharov@users.noreply.github.com> Date: Thu, 15 Feb 2024 05:15:21 -0500 Subject: [PATCH] Fix windows examples CI by upgrading TLS trust store (#1171) --- .bazelci/config.yaml | 2 ++ .bazelci/windows-update-certs.ps1 | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 .bazelci/windows-update-certs.ps1 diff --git a/.bazelci/config.yaml b/.bazelci/config.yaml index bba12dba..e410466b 100644 --- a/.bazelci/config.yaml +++ b/.bazelci/config.yaml @@ -157,6 +157,8 @@ tasks: - "-//cmake_hello_world_lib/static:libhello_example" - "-//cmake_hello_world_lib/static:test_hello" - "-//cmake_with_data/..." + batch_commands: + - powershell -noexit "& "".\..\.bazelci\windows-update-certs.ps1""" build_targets: *windows_targets test_targets: *windows_targets build_flags: diff --git a/.bazelci/windows-update-certs.ps1 b/.bazelci/windows-update-certs.ps1 new file mode 100644 index 00000000..bf76336a --- /dev/null +++ b/.bazelci/windows-update-certs.ps1 @@ -0,0 +1,6 @@ +cd $env:USERPROFILE; +Invoke-WebRequest https://curl.haxx.se/ca/cacert.pem -OutFile $env:USERPROFILE\cacert.pem; +$plaintext_pw = 'PASSWORD'; +$secure_pw = ConvertTo-SecureString $plaintext_pw -AsPlainText -Force; +& openssl.exe pkcs12 -export -nokeys -out certs.pfx -in cacert.pem -passout pass:$plaintext_pw; +Import-PfxCertificate -Password $secure_pw -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx;