Skip to content

Commit 6b805cb

Browse files
TLS API updates (aws#11)
* Updated to latest aws-c-common, aws-c-io * API updates for TLS API changes in aws-c-io * added .idea (clion) to gitignore * .DS_Store added to gitignore * Forced commit hashes on aws-c-common and aws-c-io to hopefully appease CI * No pkcs12 on non-apple * clang-format * Update to aws-c-common v0.3.4 * Respect the configured allocator * Updated to aws-c-mqtt v0.2.2 * clang-format * Updated to aws-c-io v0.2.3
1 parent c6e356e commit 6b805cb

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
.DS_Store

aws-common-runtime/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set(AWS_DEPS_DOWNLOAD_DIR "${AWS_DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependen
1717

1818
message("install dir ${AWS_DEPS_INSTALL_DIR}")
1919
set(AWS_C_COMMON_URL "https://github.com/awslabs/aws-c-common.git")
20-
set(AWS_C_COMMON_SHA "v0.3.2")
20+
set(AWS_C_COMMON_SHA "v0.3.4")
2121
include(BuildAwsCCommon)
2222

2323
if (UNIX AND NOT APPLE)
@@ -27,11 +27,11 @@ if (UNIX AND NOT APPLE)
2727
endif()
2828

2929
set(AWS_C_IO_URL "https://github.com/awslabs/aws-c-io.git")
30-
set(AWS_C_IO_SHA "v0.2.2")
30+
set(AWS_C_IO_SHA "v0.2.3")
3131
include(BuildAwsCIO)
3232

3333
set(AWS_C_MQTT_URL "https://github.com/awslabs/aws-c-mqtt.git")
34-
set(AWS_C_MQTT_SHA "v0.2.1")
34+
set(AWS_C_MQTT_SHA "v0.2.2")
3535
include(BuildAwsCMqtt)
3636

3737
set(AWS_C_CAL_URL "https://github.com/awslabs/aws-c-cal.git")

source/io/TlsOptions.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,28 @@ namespace Aws
2727
TlsContextOptions TlsContextOptions::InitDefaultClient() noexcept
2828
{
2929
TlsContextOptions ctxOptions;
30-
aws_tls_ctx_options_init_default_client(&ctxOptions.m_options);
30+
aws_tls_ctx_options_init_default_client(&ctxOptions.m_options, g_allocator);
3131
return ctxOptions;
3232
}
3333

3434
TlsContextOptions TlsContextOptions::InitClientWithMtls(const char *certPath, const char *pKeyPath) noexcept
3535
{
3636
TlsContextOptions ctxOptions;
37-
aws_tls_ctx_options_init_client_mtls(&ctxOptions.m_options, certPath, pKeyPath);
37+
aws_tls_ctx_options_init_client_mtls_from_path(&ctxOptions.m_options, g_allocator, certPath, pKeyPath);
3838
return ctxOptions;
3939
}
40-
40+
#ifdef __APPLE__
4141
TlsContextOptions TlsContextOptions::InitClientWithMtlsPkcs12(
4242
const char *pkcs12Path,
4343
const char *pkcs12Pwd) noexcept
4444
{
4545
TlsContextOptions ctxOptions;
46-
aws_tls_ctx_options_init_client_mtls_pkcs12(&ctxOptions.m_options, pkcs12Path, pkcs12Pwd);
46+
struct aws_byte_cursor password = aws_byte_cursor_from_c_str(pkcs12Pwd);
47+
aws_tls_ctx_options_init_client_mtls_pkcs12_from_path(
48+
&ctxOptions.m_options, g_allocator, pkcs12Path, &password);
4749
return ctxOptions;
4850
}
51+
#endif
4952

5053
bool TlsContextOptions::IsAlpnSupported() noexcept { return aws_tls_is_alpn_available(); }
5154

@@ -61,7 +64,7 @@ namespace Aws
6164

6265
void TlsContextOptions::OverrideDefaultTrustStore(const char *caPath, const char *caFile) noexcept
6366
{
64-
aws_tls_ctx_options_override_default_trust_store(&m_options, caPath, caFile);
67+
aws_tls_ctx_options_override_default_trust_store_from_path(&m_options, caPath, caFile);
6568
}
6669

6770
void InitTlsStaticState(Aws::Crt::Allocator *alloc) noexcept { aws_tls_init_static_state(alloc); }

0 commit comments

Comments
 (0)