Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#10919) libcurl: Expose control to --with_ca_bundle and --with_ca_path #10922

Merged
merged 1 commit into from
May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions recipes/libcurl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class LibcurlConan(ConanFile):
"with_verbose_debug": [True, False],
"with_symbol_hiding": [True, False],
"with_unix_sockets": [True, False],
"with_ca_bundle": "ANY",
"with_ca_path": "ANY",
}
default_options = {
"shared": False,
Expand Down Expand Up @@ -96,6 +98,8 @@ class LibcurlConan(ConanFile):
"with_verbose_debug": True,
"with_symbol_hiding": False,
"with_unix_sockets": True,
"with_ca_bundle": None,
"with_ca_path": None,
}

generators = "cmake", "cmake_find_package_multi", "pkg_config", "cmake_find_package"
Expand Down Expand Up @@ -420,6 +424,16 @@ def _get_configure_command_args(self):
if not self.options.with_ntlm_wb:
params.append("--disable-ntlm-wb")

if self.options.with_ca_bundle == False:
params.append("--without-ca-bundle")
elif self.options.with_ca_bundle:
params.append("--with-ca-bundle=" + str(self.options.with_ca_bundle))

if self.options.with_ca_path == False:
params.append('--without-ca-path')
elif self.options.with_ca_path:
params.append("--with-ca-path=" + str(self.options.with_ca_path))

# Cross building flags
if tools.cross_building(self.settings):
if self.settings.os == "Linux" and "arm" in self.settings.arch:
Expand Down Expand Up @@ -561,6 +575,16 @@ def _configure_cmake(self):
self._cmake.definitions["CURL_DISABLE_NTLM"] = True
self._cmake.definitions["NTLM_WB_ENABLED"] = self.options.with_ntlm_wb

if self.options.with_ca_bundle == False:
self._cmake.definitions['CURL_CA_BUNDLE'] = 'none'
elif self.options.with_ca_bundle:
self._cmake.definitions['CURL_CA_BUNDLE'] = self.options.with_ca_bundle

if self.options.with_ca_path == False:
self._cmake.definitions['CURL_CA_PATH'] = 'none'
elif self.options.with_ca_path:
self._cmake.definitions['CURL_CA_PATH'] = self.options.with_ca_path

self._cmake.configure(build_folder=self._build_subfolder)
return self._cmake

Expand Down