Search code examples
c++visual-studio-2017vcpkg

vcpkg install fails with "SSL connect error"


When I try to install libxml2 packages with vcpkg, it gives me below error.

How can overcome this issue? Is there a way to use http instead of https in vcpkg? Or can I skipp sll check?

.\vcpkg install libxml2

The following packages will be built and installed:

  • libiconv:x86-windows
  • liblzma:x86-windows
  • libxml2:x86-windows
  • zlib:x86-windows

Additional packages (*) will be installed to complete this operation.

Starting package 1/4: zlib:x86-windows

Building package zlib:x86-windows...

-- CURRENT_INSTALLED_DIR=...

-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...

-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz... Failed. Status: 56;"Failure when receiving data from the peer"

-- Downloading https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz...

-- Downloading https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz... Failed. Status: 35;"SSL connect error"

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:82 (message): Failed to download file. Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues

Call Stack (most recent call first): ports/zlib/portfile.cmake:3 (vcpkg_download_distfile) scripts/ports.cmake:72 (include)

Error: Building package zlib:x86-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with .\vcpkg update, then submit an issue at https://github.com/Microsoft/vcpkg/issues including:


Solution

  • I could resolve this problem by editing profile.cmake file in vcpkg\ports\libxml2\ folder. I added ftp link URLS "ftp://xmlsoft.org/libxml2/libxml2-2.9.4.tar.gz" and vcpkg downloaded files over ftp.