Skip to content

Commit

Permalink
using the api wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Feb 21, 2024
1 parent 6a4a47b commit 1beb3af
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/tls_handler_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,15 @@ static int s_test_duplicate_cert_import(struct aws_allocator *allocator, void *c
(void)ctx;

aws_io_library_init(allocator);
struct aws_byte_buf cert_buf = {0};
struct aws_byte_buf key_buf = {0};

# if !defined(AWS_OS_IOS)
struct aws_byte_cursor cert_cur = aws_byte_cursor_from_c_str("testcert_dup.pem");
struct aws_byte_cursor key_cur = aws_byte_cursor_from_c_str("testkey.pem");

ASSERT_SUCCESS(aws_byte_buf_init_from_file(&cert_buf, allocator, "testcert0.pem"));
ASSERT_SUCCESS(aws_byte_buf_init_from_file(&key_buf, allocator, "testkey.pem"));
struct aws_byte_cursor cert_cur = aws_byte_cursor_from_buf(&cert_buf);
struct aws_byte_cursor key_cur = aws_byte_cursor_from_buf(&key_buf);
struct aws_tls_ctx_options tls_options = {0};
AWS_FATAL_ASSERT(
AWS_OP_SUCCESS == aws_tls_ctx_options_init_client_mtls(&tls_options, allocator, &cert_cur, &key_cur));
Expand All @@ -2197,6 +2202,8 @@ static int s_test_duplicate_cert_import(struct aws_allocator *allocator, void *c

/* clean up */
aws_tls_ctx_release(tls);
aws_byte_buf_clean_up(&cert_buf);
aws_byte_buf_clean_up(&key_buf);
aws_io_library_clean_up();

return AWS_OP_ERR;
Expand Down

0 comments on commit 1beb3af

Please sign in to comment.