AWS communication

Hi,
I am trying to communicate with AWS.
I was able to communicate with AWS using the HL7692 module. I am using inbuilt TLS support of the HL7692 module.
But in this approach, I am writing my private key into the HL7692 module. Since anyone can tap the HL module lines are tap my private key, I don’t want to write my private key into the HL module.
To solve that I will do encryption and decryption within my firmware. For this, I need to open a socket and send encrypted data through it to AWS.

  1. How can I open a socket in this use case?
  2. Is there is any example code that I can refer to? (I am trying to use mbedtls)
  3. Is there is any other better approach for this?

You can open simple tcp socket

Thanks for the quick reply.

Do you have any example code that I can refer to.(Communicating to AWS cloud is preferred ) Need not be using mbedtls.

Didn’t you already can communicate to the AWS server?
What commands are you using?

I am using at commands to send data to AWS. I will open a secure socket using AT command. I will create MQTT packet in my application program. i will forward that packet to the created socket.

Now I want to open a simple socket. But i don’t know how to do the TLS operation in my firmware. I want some help to do the TLS operation in my firmware.
Or,
Is there any possibility to create a secure socket with out using the device private key. Root certificate and device certificate will be written into the the HL module.

originally you say " I will do encryption and decryption within my firmware", but now you say " i don’t know how to do the TLS operation in my firmware.", which one is correct?

Sorry for the confusion.
I don’t know how to do TLS operation in firmware.

do you have OpenSSL in your FW?

BTW, when you do +KHTTPSCFG, have you set the <sec_level> to zero as no authentication? does this need a certificate?

I am using Amazon freeRTOS.
In that we have mbedtls. But I don’t know how to configure it with the HL module.

Also, we have a crypto module https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATCRYPTOAUTH-XPRO

I was able to open a simple socket
I am using this at commands to send data.
AT+KTCPSND=1,27
mqtt packet to be sent EOF–Pattern–

if you have TLS in your MCU, you can dial up via HL modem.

Thanks for the reply.
I will try to do that.