Skip to content

Commit 503e733

Browse files
authored
Fix crash when assigning tls options for x509 credentials provider (aws#210)
1 parent 1578b64 commit 503e733

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

source/Api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include <aws/crt/external/cJSON.h>
88
#include <aws/crt/io/TlsOptions.h>
99

10-
#include <aws/common/ref_count.h>
1110
#include <aws/auth/auth.h>
11+
#include <aws/common/ref_count.h>
1212
#include <aws/http/http.h>
1313
#include <aws/mqtt/mqtt.h>
1414

source/auth/Credentials.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ namespace Aws
290290

291291
proxy_options.host = aws_byte_cursor_from_c_str(proxy_config.HostName.c_str());
292292
proxy_options.port = proxy_config.Port;
293-
proxy_options.tls_options = proxy_config.TlsOptions->GetUnderlyingHandle();
293+
if (proxy_config.TlsOptions.has_value())
294+
{
295+
proxy_options.tls_options = proxy_config.TlsOptions->GetUnderlyingHandle();
296+
}
294297
proxy_options.auth_type = (enum aws_http_proxy_authentication_type)proxy_config.AuthType;
295298
proxy_options.auth_username = aws_byte_cursor_from_c_str(proxy_config.BasicAuthUsername.c_str());
296299
proxy_options.auth_password = aws_byte_cursor_from_c_str(proxy_config.BasicAuthPassword.c_str());

0 commit comments

Comments
 (0)