Skip to content

Commit cc74395

Browse files
committed
Propagate SOCKS5 options to Credentials
1 parent 042437f commit cc74395

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

include/aws/crt/auth/Credentials.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <aws/crt/Types.h>
99
#include <aws/crt/http/HttpConnection.h>
1010
#include <aws/crt/io/TlsOptions.h>
11+
#include <aws/crt/io/Socks5ProxyOptions.h>
1112

1213
#include <chrono>
1314
#include <functional>
@@ -290,9 +291,14 @@ namespace Aws
290291
struct AWS_CRT_CPP_API CredentialsProviderX509Config
291292
{
292293
CredentialsProviderX509Config()
293-
: Bootstrap(nullptr), TlsOptions(), ThingName(), RoleAlias(), Endpoint(), ProxyOptions()
294-
{
295-
}
294+
: Bootstrap(nullptr),
295+
TlsOptions(),
296+
ThingName(),
297+
RoleAlias(),
298+
Endpoint(),
299+
ProxyOptions(),
300+
Socks5ProxyOptions()
301+
{}
296302

297303
/**
298304
* Connection bootstrap to use to create the http connection required to
@@ -324,6 +330,11 @@ namespace Aws
324330
* (Optional) Http proxy configuration for the http request that fetches credentials
325331
*/
326332
Optional<Http::HttpClientConnectionProxyOptions> ProxyOptions;
333+
334+
/**
335+
* (Optional) SOCKS5 proxy configuration for the http request that fetches credentials
336+
*/
337+
Optional<Io::Socks5ProxyOptions> Socks5ProxyOptions;
327338
};
328339

329340
/**

source/auth/Credentials.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@ namespace Aws
323323
raw_config.proxy_options = &proxy_options;
324324
}
325325

326+
const struct aws_socks5_proxy_options *socks5_proxy_options = nullptr;
327+
if (config.Socks5ProxyOptions.has_value())
328+
{
329+
socks5_proxy_options = config.Socks5ProxyOptions->GetUnderlyingHandle();
330+
raw_config.socks5_proxy_options = socks5_proxy_options;
331+
}
332+
326333
return s_CreateWrappedProvider(aws_credentials_provider_new_x509(allocator, &raw_config), allocator);
327334
}
328335

0 commit comments

Comments
 (0)