Mg_connect_http delay UART response

  • Using the ESP8266 platform.
  • Using UART port to receive DATA packet and response with ACK packet
  • UART driver callback is used to process the UART packets
  • When 2000 bytes is received, it formats HTTP packet and send to server using mg_connect_http()

Here are a print out of the responding time of the receiving packets.
The time show the delta between each received data packet and ACK response packet.
From what I see, each time “SW ECDH curve 3” is called, UART callback is delayed >600ms
I have tried to access a site with TLS disabled , then the delay will be <200ms.

main.c:206 Put : 21 ms
main.c:206 Ack : 3 ms
mg_ssl_if_mbedtls.c:30 0x3fff4cbc ciphersuite: TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
main.c:206 Put : 66 ms
main.c:206 Ack : 3 ms
main.c:206 Put : 28 ms
main.c:206 Ack : 4 ms
SW ECDH curve 3
mgos_mongoose.c:66 New heap free LWM: 4480
main.c:206 Put : 692 ms
main.c:206 Ack : 3 ms
main.c:206 MG_EV_CONNECT : 9 ms
main.c:206 Put : 23 ms
main.c:206 Ack : 3 ms

Additional test result, calling mg_connect_http() to event MG_EV_CLOSE on 2 different links :
http://example.com (200ms)
https://example.com (700ms)

Is this a limitation using mg_connect_http() ??