Add vcpkg cache cleanup step and improve Windows certificate error handling

This commit is contained in:
yhirose
2026-01-03 01:10:37 -05:00
parent 3271060bc4
commit c59d76d721
2 changed files with 12 additions and 2 deletions

View File

@@ -142,6 +142,11 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Clean vcpkg cache for different configurations
run: |
if exist "$env:VCPKG_ROOT\installed" rmdir /s /q "$env:VCPKG_ROOT\installed"
if exist "$env:VCPKG_ROOT\packages" rmdir /s /q "$env:VCPKG_ROOT\packages"
shell: pwsh
- name: Setup msbuild on windows
uses: microsoft/setup-msbuild@v2
- name: Install vcpkg dependencies
@@ -168,4 +173,4 @@ jobs:
env:
VCPKG_ROOT: "C:/vcpkg"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_BINARY_SOURCES: "clear"

View File

@@ -7295,7 +7295,10 @@ inline bool verify_cert_with_windows_schannel(X509 *server_cert,
CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT,
nullptr, &chain_context);
if (!chain_result || !chain_context) { return false; }
if (!chain_result || !chain_context) {
out_wincrypt_error = GetLastError();
return false;
}
auto chain_guard =
detail::scope_exit([&] { CertFreeCertificateChain(chain_context); });
@@ -7305,6 +7308,8 @@ inline bool verify_cert_with_windows_schannel(X509 *server_cert,
// Check if chain has errors
if (chain_context->TrustStatus.dwErrorStatus != CERT_TRUST_NO_ERROR) {
// Set wincrypt_error to the chain trust error
out_wincrypt_error = chain_context->TrustStatus.dwErrorStatus;
return false;
}