aws_iot mqtt_connect and client_connect failing

Hi, I am working on using nrf7002dk to connect to AWS over WiFi. So far I have been able to connect to WiFi and send a HTTP get request through DHCPV4. When I continue to aws_iot library, I have been able to call init, subscribe to topics, and provisioning certificates work (or not return error when they return). But whenever I call aws_iot_connect, I get
<err> aws_iot: mqtt_connect, error: -22 and
<wrn> aws_iot: connect_client failed, error: -7
Looking up the error numbers, I find that -22 stands for Invalid argument, and -7 stands for bad private key. I have tried to format my certificates header according to the library’s example and some posts here on nordic so I am pretty sure my certificates are not wrong. It would be great if I can get some help on the issue! Thank you for reading, and looking forward to any help that may come. Attached are a rough outline of my aws_iot function calls, my certificate header, and my prj.conf file. I have taken out sensitive parts in the code, please let me know if more info is needed!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Standard library
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <zephyr/kernel.h>
// Zephyr network library
#include <zephyr/net/net_if.h>
#include <zephyr/net/wifi_mgmt.h>
#include <zephyr/net/net_event.h>
#include <zephyr/logging/log.h>
#include <zephyr/net/ethernet.h>
#include <zephyr/net/ethernet_mgmt.h>
#include <zephyr/net/socket.h>
#include <zephyr/net/net_context.h>
// HTTP Module
#include <zephyr/net/http/client.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
certs.h6740.prj.conf
-Eric