From a32523b882c375e40429022f23f756b0405e8e60 Mon Sep 17 00:00:00 2001 From: Phoebus Mak Date: Mon, 11 Sep 2023 17:06:50 +0000 Subject: [PATCH] Make azure sdk stick to winhttp if possible --- cpp/arcticdb/storage/azure/azure_storage.cpp | 8 +++++--- python/arcticdb/arctic.py | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cpp/arcticdb/storage/azure/azure_storage.cpp b/cpp/arcticdb/storage/azure/azure_storage.cpp index c74a0878e26..daf2dfa175f 100644 --- a/cpp/arcticdb/storage/azure/azure_storage.cpp +++ b/cpp/arcticdb/storage/azure/azure_storage.cpp @@ -41,10 +41,12 @@ AzureStorage::AzureStorage(const LibraryPath &library_path, OpenMode mode, const } Azure::Storage::Blobs::BlobClientOptions AzureStorage::get_client_options(const Config &conf) { - Azure::Core::Http::CurlTransportOptions curl_transport_options; - curl_transport_options.CAInfo = conf.ca_cert_path(); BlobClientOptions client_options; - client_options.Transport.Transport = std::make_shared(curl_transport_options); + if (!conf.ca_cert_path().empty()) {//WARNING: Setting ca_cert_path will force Azure sdk uses libcurl as backend support, instead of winhttp + Azure::Core::Http::CurlTransportOptions curl_transport_options; + curl_transport_options.CAInfo = conf.ca_cert_path(); + client_options.Transport.Transport = std::make_shared(curl_transport_options); + } return client_options; } diff --git a/python/arcticdb/arctic.py b/python/arcticdb/arctic.py index fcc1a111a25..0b8ea05d2f9 100644 --- a/python/arcticdb/arctic.py +++ b/python/arcticdb/arctic.py @@ -103,6 +103,8 @@ def __init__(self, uri: str, encoding_version: EncodingVersion = DEFAULT_ENCODIN | | "/etc/pki/tls/cacert.pem" OpenELEC | | | "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" CentOS/RHEL 7 | | | "/etc/ssl/cert.pem" Alpine Linux | + | | WARNING for WINDOWS USER: Not leaving this empty will switch the backend support of Azure SDK from winhttp to libcurl. If ca cert path is needed to be | + | | specified, set it in Windows setting so winhttp will be used still | +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ Exception: Azure exceptions message always ends with `{AZURE_SDK_HTTP_STATUS_CODE}:{AZURE_SDK_REASON_PHRASE}`.