Arm Mbed and Pelion Device Management support forum

Usage of HTTPS server and HTTPS client together

Hello everyone!

I am developing IOT device on STM32F427 MCU with web server on-board using HTTPS. It is working fine. In a separate thread (FreeRTOS) I want to create HTTPS client to automatically upload data to remote server with events information.

Is it possible to unite HTTPS server and HTTPS client together? What are the things to take care about?

Thank you.

Hi @EvgeniyVasyliev
Thank you for your question!
A TLS peer can either be a server or a client, but not both.
You can see in the API mbedtls_ssl_config_defaults() that it receives as a parameter endpoint whether it is a client or a server.
To establish both a client and a server, you will need two instances of mbedtls_ssl_config and mbedtls_ssl_context().
You should probably take into consideration also, depending on your system, the network possible issues, where a port is already in use for the other peer.
Regards
Mbed TLS Support
Ron