Skip to content

Commit

Permalink
set some more potential ca paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hafenkran committed Nov 13, 2024
1 parent 9eb1c83 commit 3a13b34
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/include/bigquery_settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ inline std::string DetectCAPath() {
"/etc/ssl/certs/ca-certificates.crt",
"/etc/pki/tls/certs/ca-bundle.crt",
"/etc/ssl/ca-bundle.pem",
"/etc/ssl/cert.pem" //
"/etc/ssl/cert.pem",
"/usr/local/share/certs/ca-root-nss.crt",
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
"/etc/openssl/certs/ca-certificates.crt",
"/var/lib/ca-certificates/ca-bundle.pem",
"/usr/local/etc/openssl/cert.pem" //
};
for (const char *path : ca_paths) {
if (std::ifstream(path).good()) {
Expand All @@ -34,7 +39,10 @@ inline std::string DetectCAPath() {
}
const char *mac_ca_paths[] = {
"/etc/ssl/cert.pem",
"/usr/local/etc/openssl/cert.pem" //
"/usr/local/etc/openssl/cert.pem",
"/usr/local/etc/[email protected]/cert.pem",
"/opt/homebrew/etc/openssl/cert.pem",
"/opt/homebrew/etc/[email protected]/cert.pem" //
};
for (const char *path : mac_ca_paths) {
if (std::ifstream(path).good()) {
Expand Down Expand Up @@ -80,9 +88,11 @@ struct BigquerySettings {
if (curl_ca_bundle_path.empty()) {
curl_ca_bundle_path = DetectCAPath();
}
#if defined(__linux__) || defined(__unix__)
if (curl_ca_bundle_path.empty()) {
throw BinderException("Curl CA bundle path not found. Try setting the 'bq_curl_ca_bundle_path' option.");
}
#endif
return curl_ca_bundle_path;
}

Expand Down

0 comments on commit 3a13b34

Please sign in to comment.