SSL_GET_HANDSHAKE_RTT(3SSL)

๐Ÿ’– SSL_GET_HANDSHAKE_RTT ๐Ÿ’–

okay bestie, gather round, because today we're talking about SSL_get_handshake_rtt from the OpenSSL manuals (that's the 3SSL girlies, you know the vibe) โœจ


๐ŸŒธ NAME ๐ŸŒธ

SSL_get_handshake_rtt โ€” get the round trip time for the SSL Handshake ๐Ÿ›ฐ๏ธ๐Ÿ’ซ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <openssl/ssl.h>

int SSL_get_handshake_rtt(const SSL *s, uint64_t *rtt);

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So SSL_get_handshake_rtt() goes and grabs the round-trip time (RTT) for your ssl, like, the whole journey there and back ๐Ÿš—๐Ÿ’จ

And the units? microseconds (us), stored as a uint64_t data type. Tiny units, big feelings. No cap ๐Ÿ’…


โญ NOTES โญ

Okay so here's the tea โ˜• โ€” this metric is made by taking two timestamps during the handshake and giving you the difference between those two times. Two little clock-pokes, one lil subtraction, slay โœจ

๐Ÿ‘‘ When you're the server ๐Ÿ‘‘

One timestamp gets taken when the server is finished writing to the client. That's during the ServerFinished in TLS 1.3 and ServerHelloDone in TLS 1.2. The other timestamp gets taken when the server is done reading the client's response โ€” which is after the client has responded with ClientFinished. Two stamps, that's it, iconic ๐Ÿ“ฎ

๐Ÿงš When you're the client ๐Ÿงš

One timestamp gets taken when the client is finished writing the ClientHello and early data (if any). The other one gets taken when the client is done reading the server's response โ€” which is after ServerFinished in TLS 1.3 and after ServerHelloDone in TLS 1.2. Symmetry? We love to see it ๐ŸŒˆ

๐Ÿ’€ The reality check ๐Ÿ’€

ngl bestie, this number is not just "the network". In addition to network propagation delay and network stack overhead, this metric includes processing time on both endpoints โ€” because it's based on TLS protocol-level messages, and the TLS protocol was not designed to measure network timings. In some cases that processing time can be significant, especially when the processing includes asymmetric cryptographic operations. so likeโ€ฆ don't cite this in your physics paper okay ๐Ÿ˜ญ

๐Ÿซถ RETURN VALUES ๐Ÿซถ

  • 1 โ€” yay!! the TLS handshake RTT was successfully retrieved ๐ŸŽ‰
  • 0 โ€” the TLS handshake RTT cannot be determined yet, bestie, be patient โณ
  • -1 โ€” an error occurred while retrieving the TLS handshake RTT ๐Ÿ˜ญ๐Ÿ’”

๐Ÿ“ HISTORY ๐Ÿ“

This function was added in OpenSSL 3.2. baby girl is new here, be nice to her ๐Ÿฅบ


Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page, babe ๐Ÿ’…โœจ version 4.0.3, dated 2026-09-29 โ€” go forth and measure those round trips responsibly, mwah ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from