Skip to content

Commit 9a2c2e1

Browse files
authored
Remove OPENSSL_VERSION_NUMBER version check for the CAPath option in libcurl (#5009)
* Remove OPENSSL_VERSION_NUMBER version check for the CAPath option in libcurl. * Revert unit test change that caused an intentional error. * Remove the openssl header.
1 parent 81d95c9 commit 9a2c2e1

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
#include "azure/core/http/transport.hpp"
1515
#include "azure/core/platform.hpp"
1616

17-
#if defined(AZ_PLATFORM_LINUX)
18-
#include <openssl/opensslv.h>
19-
#if OPENSSL_VERSION_NUMBER >= 0x00905100L
20-
#define _azure_SUPPORT_SETTING_CAPATH
21-
#endif // OPENSSL_VERSION_NUMBER >= 0x00905100L
22-
#endif // defined(AZ_PLATFORM_LINUX)
23-
2417
namespace Azure { namespace Core { namespace Http {
2518
class CurlNetworkConnection;
2619

@@ -130,7 +123,7 @@ namespace Azure { namespace Core { namespace Http {
130123
*/
131124
std::string CAInfo;
132125

133-
#if defined(_azure_SUPPORT_SETTING_CAPATH)
126+
#if defined(AZ_PLATFORM_LINUX)
134127
/**
135128
* @brief Path to a directory which holds PEM encoded file, containing the certificate
136129
* authorities sent to libcurl handle directly.

sdk/core/azure-core/src/http/curl/curl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption
12831283
key.append(",");
12841284
key.append(!options.CAInfo.empty() ? options.CAInfo : "0");
12851285
key.append(",");
1286-
#if defined(_azure_SUPPORT_SETTING_CAPATH)
1286+
#if defined(AZ_PLATFORM_LINUX)
12871287
key.append(!options.CAPath.empty() ? options.CAPath : "0");
12881288
#else
12891289
key.append("0"); // CAPath is always empty on Windows;
@@ -2320,7 +2320,7 @@ CurlConnection::CurlConnection(
23202320
}
23212321
}
23222322

2323-
#if defined(_azure_SUPPORT_SETTING_CAPATH)
2323+
#if defined(AZ_PLATFORM_LINUX)
23242324
if (!options.CAPath.empty())
23252325
{
23262326
if (!SetLibcurlOption(m_handle, CURLOPT_CAPATH, options.CAPath.c_str(), &result))

sdk/core/azure-core/test/ut/curl_options_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ namespace Azure { namespace Core { namespace Test {
235235
.ConnectionPoolIndex.clear());
236236
}
237237

238-
#if defined(_azure_SUPPORT_SETTING_CAPATH)
238+
#if defined(AZ_PLATFORM_LINUX)
239239
TEST(CurlTransportOptions, setCADirectory)
240240
{
241241
Azure::Core::Http::CurlTransportOptions curlOptions;

0 commit comments

Comments
 (0)