SSL_GET_HANDSHAKE_RTT(3ossl)

✨ SSL_GET_HANDSHAKE_RTT πŸ’–

okay so bestie, this is SSL_get_handshake_rtt from the OpenSSL family of man pages (that's the 3ossl manual, section 3, iykyk) β€” it's the one that tells you how long the SSL handshake round trip actually took. clocked it. ⏱️


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

SSL_get_handshake_rtt() goes and retrieves the round-trip time (RTT) for the ssl. yes, for the ssl. it's giving "how long did this whole back-and-forth take".

this metric is in microseconds (us), and it's stored as a uint64_t data type. tiny units, big number, no cap. πŸ’…


πŸ‘‘ NOTES πŸ‘‘

so how does it even get made? the way that this works is: it takes two timestamps during the handshake and just gives you the difference between those two times. iconic behaviour honestly.

When acting as the server:

  • one timestamp is 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 is taken when the server is done reading the client's response β€” that's after the client has responded with ClientFinished.

When acting as the client:

  • one timestamp is taken when the client is finished writing the ClientHello and early data (if any).
  • the other is taken when the client is done reading the server's response β€” after ServerFinished in TLS 1.3, and after ServerHelloDone in TLS 1.2.
⚠️ real talk bestie: on top of network propagation delay and network stack overhead, this metric also includes processing time on both endpoints. because it's based on TLS protocol-level messages, and the TLS protocol is not designed to measure network timings. in some cases that processing time can be significant β€” especially when the processing includes asymmetric cryptographic operations. so don't come for it, it's doing its best. 😭

πŸŽ€ RETURN VALUES πŸŽ€

  • returns 1 if the TLS handshake RTT is successfully retrieved. slay. ✨
  • returns 0 if the TLS handshake RTT cannot be determined yet. (patience, babe.)
  • returns -1 if, while retrieving the TLS handshake RTT, an error occurs. πŸ’€

🌈 HISTORY 🌈

this function was added in OpenSSL 3.2. babygirl is relatively new to the scene.


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>.


mwah πŸ’‹ that's the whole page, bestie. this was pulled straight from OpenSSL 3.5.9, dated 2026-09-29, filed under the SSL_GET_HANDSHAKE_RTT(3ossl) header β€” go measure some round trips, you've got this. 🫢✨

πŸ“¦ where this page comes from