Skip to content

Commit f71d583

Browse files
Merge pull request BOINC#4545 from AenBleidd/vko_4542_build_curl_for_windows_without_openssl
[Windows] Build curl for Windows without openssl.
2 parents d8ca941 + ee640ea commit f71d583

File tree

3 files changed

+10
-50
lines changed

3 files changed

+10
-50
lines changed

client/http_curl.cpp

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ void HTTP_OP::reset() {
252252

253253
HTTP_OP::HTTP_OP() {
254254
safe_strcpy(m_url, "");
255-
safe_strcpy(m_curl_ca_bundle_location, "");
256255
safe_strcpy(m_curl_user_credentials, "");
257256
content_length = 0;
258257
file_offset = 0;
@@ -486,50 +485,7 @@ int HTTP_OP::libcurl_exec(
486485

487486
// if the above is nonzero, you need the following:
488487
//
489-
#ifdef _WIN32
490-
if (strlen(m_curl_ca_bundle_location) == 0) {
491-
TCHAR szPath[MAX_PATH-1];
492-
GetModuleFileName(NULL, szPath, (sizeof(szPath)/sizeof(TCHAR)));
493-
494-
TCHAR *pszProg = strrchr(szPath, '\\');
495-
if (pszProg) {
496-
szPath[pszProg - szPath + 1] = 0;
497-
498-
strlcat(
499-
m_curl_ca_bundle_location,
500-
szPath,
501-
sizeof(m_curl_ca_bundle_location)
502-
);
503-
strlcat(
504-
m_curl_ca_bundle_location,
505-
CA_BUNDLE_FILENAME,
506-
sizeof(m_curl_ca_bundle_location)
507-
);
508-
509-
if (log_flags.http_debug) {
510-
msg_printf(
511-
project,
512-
MSG_INFO,
513-
"[http] HTTP_OP::libcurl_exec(): ca-bundle '%s'",
514-
m_curl_ca_bundle_location
515-
);
516-
}
517-
}
518-
}
519-
if (boinc_file_exists(m_curl_ca_bundle_location)) {
520-
// call this only if a local copy of ca-bundle.crt exists;
521-
// otherwise, let's hope that it exists in the default place
522-
//
523-
curl_easy_setopt(curlEasy, CURLOPT_CAINFO, m_curl_ca_bundle_location);
524-
if (log_flags.http_debug) {
525-
msg_printf(
526-
project,
527-
MSG_INFO,
528-
"[http] HTTP_OP::libcurl_exec(): ca-bundle set"
529-
);
530-
}
531-
}
532-
#else
488+
#ifndef _WIN32
533489
if (boinc_file_exists(CA_BUNDLE_FILENAME)) {
534490
// call this only if a local copy of ca-bundle.crt exists;
535491
// otherwise, let's hope that it exists in the default place

client/http_curl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ class HTTP_OP {
5858
PROJECT* project; // associated project, if any
5959

6060
char m_url[1024];
61-
char m_curl_ca_bundle_location[256];
62-
// string needed for ssl support
6361
char m_curl_user_credentials[1024];
6462
// string needed for proxy username/password
6563

win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,19 @@
166166
<Exec Command="$(TMP)\7z\7za x $(TMP)\cublas_dev.exe -onvcc -aoa" WorkingDirectory="$(CudaRootDir)" ConsoleToMSBuild="true" />
167167
<Touch Files="$(CudaGuardFile)" AlwaysCreate="true" />
168168
</Target>
169-
<Target Name="InstallVcpkg" BeforeTargets="Build3rdPartyLibraries" DependsOnTargets="CreateFolders" AfterTargets="DownloadCUDA">
169+
<Target Name="InstallVcpkg" BeforeTargets="RemoveOutdated3rdPartyLibraries" DependsOnTargets="CreateFolders" AfterTargets="DownloadCUDA">
170170
<Exec Command="git clone https://github.com/microsoft/vcpkg" WorkingDirectory="$(Windows3rdPartyBuildDir)" ConsoleToMSBuild="true" Condition="!Exists($(VcpkgRootDir))" />
171171
<Exec Command="git pull" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" />
172172
<Exec Command="bootstrap-vcpkg.bat" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" />
173173
</Target>
174-
<Target Name="Build3rdPartyLibraries" BeforeTargets="ClCompile" DependsOnTargets="InstallVcpkg" AfterTargets="InstallVcpkg">
175-
<Exec Command="vcpkg.exe install curl[core,openssl] wxwidgets opencl rappture gtest --overlay-triplets=../../vcpkg_ports/triplets/$(VcpkgTripletConfig) --triplet $(VcpkgTripletName) --clean-after-build" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" />
174+
<Target Name="RemoveOutdated3rdPartyLibraries" BeforeTargets="Build3rdPartyLibraries" DependsOnTargets="InstallVcpkg" AfterTargets="InstallVcpkg">
175+
<Exec Command="vcpkg.exe list | findstr curl\[openssl\]:$(VcpkgTripletName)" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" ContinueOnError="WarnAndContinue">
176+
<Output TaskParameter="ConsoleOutput" PropertyName="OutdatedCurl" />
177+
</Exec>
178+
<Exec Command="vcpkg.exe remove curl --overlay-triplets=../../vcpkg_ports/triplets/$(VcpkgTripletConfig) --triplet $(VcpkgTripletName)" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" Condition="$(OutdatedCurl) != ''" />
179+
</Target>
180+
<Target Name="Build3rdPartyLibraries" BeforeTargets="ClCompile" DependsOnTargets="RemoveOutdated3rdPartyLibraries" AfterTargets="RemoveOutdated3rdPartyLibraries">
181+
<Exec Command="vcpkg.exe install openssl curl[core,schannel] wxwidgets opencl rappture gtest --overlay-triplets=../../vcpkg_ports/triplets/$(VcpkgTripletConfig) --triplet $(VcpkgTripletName) --recurse --clean-after-build" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" />
176182
<Exec Command="vcpkg.exe install ftgl --overlay-triplets=../../vcpkg_ports/triplets/$(VcpkgTripletConfig) --triplet $(VcpkgTripletName) --clean-after-build" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" Condition="'$(Platform)' == 'x64'" />
177183
<Exec Command="vcpkg.exe upgrade --no-dry-run --overlay-triplets=../../vcpkg_ports/triplets/$(VcpkgTripletConfig) --triplet $(VcpkgTripletName)" WorkingDirectory="$(VcpkgRootDir)" ConsoleToMSBuild="true" />
178184
</Target>

0 commit comments

Comments
 (0)