I'm developing a system consisting of a mobile application and an embedded device that talk to each other. I'm using mbed TLS (formerly known as Polar SSL).
The problem is that the embedded device performs the TLS handshake in about 7 seconds, which is too much for our use case.
Better MCU necessary? Changing the MCU (ESP8266) for a more powerful one is the obvious solution. However, could the TLS handshake also be speded up without changing the MCU?
Caching maybe? I read about session caching, how much would this speed things up? I have to assume that a device will be controlled by multiple users, so various sessions would need to be cached. I can't waste memory.
Authentication is not a problem, I'm using 1024 RSA. Could other algorithms (such as Diffie-Hellman or ECC) speed things up?
Handshake breakdown
Edit:
Step by step handshake times:
. Performing the SSL/TLS handshake:
hello request...0ms
client hello...30ms
server hello...0ms
server cert...0ms
server key exchange...4490ms
cert request...0ms
server hello done...0ms
client cert...0ms
client key exchange...3310ms
verify cert...0ms
client change cipher spec...0ms
client finished...10ms
server change cipher spec...0ms
server finished...0ms
flush buffers...0ms
hs wrapup...0ms
-------------------------------------------
-----------------hs done!------------------
-------------------------------------------
total: 7861