Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3552

SDK • Slow TLS (server) handshake (~3 seconds) normal?

$
0
0
I was testing enabling TLS support on Pico HTTP server (using mbedtls_config.h from pico-examples), and noticed about 3 second delay during TLS handshake on incoming connections. Is this to be expected or is there perhaps some tricks that could be used to speed up the TLS handshake?

Code:

    1 0.000000000  192.168.1.40 → 192.168.4.221 TCP 74 45296 → 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=1271741520 TSecr=0 WS=128    2 0.105772747 192.168.4.221 → 192.168.1.40  TCP 60 443 → 45296 [SYN, ACK] Seq=0 Ack=1 Win=17520 Len=0 MSS=1460    3 0.105825030  192.168.1.40 → 192.168.4.221 TCP 54 45296 → 443 [ACK] Seq=1 Ack=1 Win=64240 Len=0    4 0.109828290  192.168.1.40 → 192.168.4.221 TLSv1 571 Client Hello    5 0.120327558 192.168.4.221 → 192.168.1.40  TLSv1.2 1201 Server Hello, Certificate, Certificate Request, Server Hello Done    6 0.120389604  192.168.1.40 → 192.168.4.221 TCP 54 45296 → 443 [ACK] Seq=518 Ack=1148 Win=63093 Len=0    7 0.122103775  192.168.1.40 → 192.168.4.221 TLSv1.2 384 Certificate, Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message    8 0.450569223  192.168.1.40 → 192.168.4.221 TCP 384 [TCP Retransmission] 45296 → 443 [PSH, ACK] Seq=518 Ack=1148 Win=63093 Len=330    9 1.090563129  192.168.1.40 → 192.168.4.221 TCP 384 [TCP Retransmission] 45296 → 443 [PSH, ACK] Seq=518 Ack=1148 Win=63093 Len=330   10 2.370580702  192.168.1.40 → 192.168.4.221 TCP 384 [TCP Retransmission] 45296 → 443 [PSH, ACK] Seq=518 Ack=1148 Win=63093 Len=330   11 3.223508406 192.168.4.221 → 192.168.1.40  TLSv1.2 105 Change Cipher Spec, Encrypted Handshake Message   12 3.223704998 192.168.4.221 → 192.168.1.40  TCP 60 [TCP Dup ACK 11#1] 443 → 45296 [ACK] Seq=1199 Ack=848 Win=16673 Len=0   13 3.224003885 192.168.4.221 → 192.168.1.40  TCP 60 [TCP Dup ACK 11#2] 443 → 45296 [ACK] Seq=1199 Ack=848 Win=16673 Len=0   14 3.224215422  192.168.1.40 → 192.168.4.221 TLSv1.2 159 Application Data

I noticed that curl was complaining about server not supporting ALPN, so I tried enabling that, but it didn't seem to have any effect on the TLS handshake speed...

Code:

#define MBEDTLS_SSL_ALPN

Statistics: Posted by vadelma-pi — Sun Jan 07, 2024 3:58 am



Viewing all articles
Browse latest Browse all 3552

Trending Articles