-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
category:vcpkg-bugThe issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Description
Describe the bug
If there is a trailing slash in the HTTP(S)_PROXY environment variables, downloads will fail with WinHttpSetOption failed with exit code 87
This doesn't seem like a vcpkg issue, but it is the only tool that I have seen this occur. Seems the workaround it to not have a trailing slash in the proxy url. But this has bugged me for a long time, so maybe just having this issue with the workaround will be enough.
$env:HTTP_PROXY=$ENV:HTTPS_PROXY="http://localhost:8080/"
vcpkg x-download readme2.md --url https://raw.githubusercontent.com/microsoft/vcpkg/f951db4fb2eafcc5649151383c8f0f6648b4e853/README.md --sha512 21ace818d7e0f311d39c5608f0ddd1d3df5c31e6b55827bf363d459f4d102765723f805a2a599f6b70bbf6b1a6d919cbb351cce2b11904665bd24039b7b4cc3d
Downloading https://raw.githubusercontent.com/microsoft/vcpkg/f951db4fb2eafcc5649151383c8f0f6648b4e853/README.md -> readme2.md
error: https://raw.githubusercontent.com/microsoft/vcpkg/f951db4fb2eafcc5649151383c8f0f6648b4e853/README.md: WinHttpSetOption failed with exit code 87.
note: If you are using a proxy, please ensure your proxy settings are correct.
Possible causes are:
1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to `https//address:port`.
This is not correct, because `https://` prefix claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr, etc...) is an HTTP proxy.
Try setting `http://address:port` to both HTTP_PROXY and HTTPS_PROXY instead.
2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings set by your proxy software. See: https://github.com/microsoft/vcpkg-tool/pull/77
The value set by your proxy might be wrong, or have same `https://` prefix issue.
3. Your proxy's remote server is our of service.
If you believe this is not a temporary download server failure and vcpkg needs to be changed to download this file from a different location, please submit an issue to https://github.com/Microsoft/vcpkg/issues
$env:HTTP_PROXY=$ENV:HTTPS_PROXY="http://localhost:8080"
vcpkg x-download readme2.md --url https://raw.githubusercontent.com/microsoft/vcpkg/f951db4fb2eafcc5649151383c8f0f6648b4e853/README.md --sha512 21ace818d7e0f311d39c5608f0ddd1d3df5c31e6b55827bf363d459f4d102765723f805a2a599f6b70bbf6b1a6d919cbb351cce2b11904665bd24039b7b4cc3d
Downloading https://raw.githubusercontent.com/microsoft/vcpkg/f951db4fb2eafcc5649151383c8f0f6648b4e853/README.md -> readme2.md
Successfully downloaded readme2.md
Environment
- OS: Windows
- Compiler: n/a
To Reproduce
Steps to reproduce the behavior:
- Set HTTP(S)_PROXY variables to a value that has a trailing
/
$env:HTTP_PROXY=$ENV:HTTPS_PROXY="http://localhost:8080/"
- Try to download any file
vcpkg x-download readme2.md --url https://raw.githubusercontent.com/microsoft/vcpkg/f951db4fb2eafcc5649151383c8f0f6648b4e853/README.md --sha512 21ace818d7e0f311d39c5608f0ddd1d3df5c31e6b55827bf363d459f4d102765723f805a2a599f6b70bbf6b1a6d919cbb351cce2b11904665bd24039b7b4cc3d
WinHttpSetOption failed with exit code 87
Expected behavior
File can be downloaded.
Failure logs
-(please attached failure logs)
Additional context
Example trying to install a package
vcpkg install tl-generator
Computing installation plan...
warning: vcpkg appears to be in a Visual Studio prompt targeting x86 but installing for x64-windows. Consider using --triplet x86-windows or --triplet x86-uwp.
The following packages will be built and installed:
tl-generator:x64-windows@2021-09-28
* vcpkg-cmake:x64-windows@2024-04-23
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
-- Using %HTTP(S)_PROXY% in environment variables.
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\duane\AppData\Local\vcpkg\archives in 603 us. Use --debug to see more details.
Installing 1/2 vcpkg-cmake:x64-windows@2024-04-23...
Building vcpkg-cmake:x64-windows@2024-04-23...
-- Installing: D:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake
-- Installing: D:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake
-- Installing: D:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake
-- Installing: D:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg-port-config.cmake
-- Installing: D:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/copyright
-- Performing post-build validation
Starting submission of vcpkg-cmake:x64-windows@2024-04-23 to 1 binary cache(s) in the background
Elapsed time to handle vcpkg-cmake:x64-windows: 49.2 ms
vcpkg-cmake:x64-windows package ABI: 59562224d2b58705abf725be052b6e81ae510f6ab612c5103a7305cc7e6152d5
Installing 2/2 tl-generator:x64-windows@2021-09-28...
Building tl-generator:x64-windows@2021-09-28...
Downloading https://github.com/TartanLlama/generator/archive/a8e421f04159199f6896b09cad2bd3c6fbb2a5fb.tar.gz -> TartanLlama-generator-a8e421f04159199f6896b09cad2bd3c6fbb2a5fb.tar.gz
error: https://github.com/TartanLlama/generator/archive/a8e421f04159199f6896b09cad2bd3c6fbb2a5fb.tar.gz: WinHttpSetOption failed with exit code 87.
Metadata
Metadata
Assignees
Labels
category:vcpkg-bugThe issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)