Skip to content

Commit d267e04

Browse files
Merge pull request #67 from awslabs/CAInfo
Added ca info configuration.
2 parents ba5fa7d + 4c1685b commit d267e04

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,16 @@ namespace Aws
112112
bool verifySSL;
113113
/**
114114
* If your Certificate Authority path is different from the default, you can tell
115-
* curl where to find your CA trust store.
115+
* clients that aren't using the default trust store where to find your CA trust store.
116+
* If you are on windows or apple, you likely don't want this.
116117
*/
117118
Aws::String caPath;
119+
/**
120+
* If you certificate file is different from the default, you can tell clients that
121+
* aren't using the default trust store where to find your ca file.
122+
* If you are on windows or apple, you likely dont't want this.
123+
*/
124+
Aws::String caFile;
118125
/**
119126
* Rate Limiter implementation for outgoing bandwidth. Default is wide-open.
120127
*/

aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class AWS_CORE_API CurlHttpClient: public HttpClient
5454
unsigned m_proxyPort;
5555
bool m_verifySSL;
5656
Aws::String m_caPath;
57+
Aws::String m_caFile;
5758
bool m_allowRedirects;
5859

5960
static std::atomic<bool> isInit;

aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ CurlHttpClient::CurlHttpClient(const ClientConfiguration& clientConfig) :
284284
m_curlHandleContainer(clientConfig.maxConnections, clientConfig.requestTimeoutMs, clientConfig.connectTimeoutMs),
285285
m_isUsingProxy(!clientConfig.proxyHost.empty()), m_proxyUserName(clientConfig.proxyUserName),
286286
m_proxyPassword(clientConfig.proxyPassword), m_proxyHost(clientConfig.proxyHost),
287-
m_proxyPort(clientConfig.proxyPort), m_verifySSL(clientConfig.verifySSL), m_caPath(clientConfig.caPath), m_allowRedirects(clientConfig.followRedirects)
287+
m_proxyPort(clientConfig.proxyPort), m_verifySSL(clientConfig.verifySSL), m_caPath(clientConfig.caPath),
288+
m_caFile(clientConfig.caFile), m_allowRedirects(clientConfig.followRedirects)
288289
{
289290
}
290291

@@ -358,6 +359,10 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(HttpRequest& request,
358359
{
359360
curl_easy_setopt(connectionHandle, CURLOPT_CAPATH, m_caPath.c_str());
360361
}
362+
if(!m_caFile.empty())
363+
{
364+
curl_easy_setopt(connectionHandle, CURLOPT_CAINFO, m_caFile.c_str());
365+
}
361366

362367
// only set by android test builds because the emulator is missing a cert needed for aws services
363368
#ifdef TEST_CERT_PATH

0 commit comments

Comments
 (0)