mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-01-19 04:52:08 +00:00
Add vcpkg cache cleanup step and improve Windows certificate error handling
This commit is contained in:
7
.github/workflows/test.yaml
vendored
7
.github/workflows/test.yaml
vendored
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user