AWS IoT and HTTPS are mutually failed

chegewara
Posts: 2230
Joined: Wed Jun 14, 2017 9:00 pm

Re: AWS IoT and HTTPS are mutually failed

Postby chegewara » Thu Jan 03, 2019 11:38 pm

Are you sure you are using CA cert, not intermediate cert?

chrismerck
Posts: 75
Joined: Tue May 29, 2018 8:00 pm

Re: AWS IoT and HTTPS are mutually failed

Postby chrismerck » Fri Jan 04, 2019 2:21 pm

Hey Samson, for what it's worth, I use multiple SSL connections simultaneously (AWS IoT over TLS with certificate validation) and HTTPS using mbedtls socket (although I'm not sure whether the certificate validation is being performed, we don't care in our application). --- No problems thus far. [EDIT: In fact, we have automated tests that perform 5x simultaneous HTTPS downloads and it performs just fine.]

User avatar
samsonch
Posts: 15
Joined: Mon Sep 03, 2018 2:24 pm

Re: AWS IoT and HTTPS are mutually failed

Postby samsonch » Fri Jan 04, 2019 3:43 pm

OK, I sort of found the problem but I don't have any solution yet.

This is nothing to do with the CA or mbedtls. The Bluetooth init causes all that problems. I don't know why. If I didn't create the Bluetooth task, everything worked great. If I enabled the Bluetooth task, only one of MQTTS or HTTPS worked and the other one would get the error from the esp-tls. It sounds like a memory problem. I checked the stack high water mark, it looked OK. I tried to increase the Bluetooth stack size, it did not work.

I also tried to do a similar thing on a small sample project, but that one worked ok. Still a myth to me!

Samson

User avatar
samsonch
Posts: 15
Joined: Mon Sep 03, 2018 2:24 pm

Re: AWS IoT and HTTPS are mutually failed

Postby samsonch » Sat Jan 05, 2019 4:35 am

I finally found the final answer. It was caused by the stack overflow. Which stack? I don't know. But when I reduced the size of each my stacks, it worked. I used stack high water mark to check some stacks, including the system stacks, I could reach out but found none. Anyway, it works now.

Samson

JimmyPedersen
Posts: 21
Joined: Sun Nov 15, 2015 4:14 am

Re: AWS IoT and HTTPS are mutually failed

Postby JimmyPedersen » Sat Jan 05, 2019 9:53 am

samsonch wrote:
Sat Jan 05, 2019 4:35 am
I finally found the final answer. It was caused by the stack overflow. Which stack? I don't know. But when I reduced the size of each my stacks, it worked. I used stack high water mark to check some stacks, including the system stacks, I could reach out but found none. Anyway, it works now.

Samson
Are you sure it's not the heap that gets too small when the stack is set high causing the xalloc's to fail?
If you get stack overflow you should need to increase the stack size, not decrease it.

User avatar
samsonch
Posts: 15
Joined: Mon Sep 03, 2018 2:24 pm

Re: AWS IoT and HTTPS are mutually failed

Postby samsonch » Sat Jan 05, 2019 1:25 pm

Hello Jimmy,

You are probably right. However, I tried to check the usages of all stacks I can find. For those, all the high water marks were still a big number. There are some system/SDK created tasks that I don't know. So, you are probably right about those stacks that I didn't check. What I reduced are the stacks under my control. Then the saved space may leave some more memory for the heap or those hidden stacks. That was what I did.

Samson

User avatar
samsonch
Posts: 15
Joined: Mon Sep 03, 2018 2:24 pm

Re: AWS IoT and HTTPS are mutually failed

Postby samsonch » Sat Jan 05, 2019 3:37 pm

By the way, I did enable the Heap Memory Debugging on the problematic build, and there wasn't any memory corruption event. So I really don't know what really caused that.

Who is online

Users browsing this forum: Baidu [Spider], djixon, Google [Bot], irfan93 and 124 guests