SSL_GET_HANDSHAKE_RTT(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… SSL_GET_HANDSHAKE_RTT πŸ’…

okay bestie so this is the <openssl/ssl.h> glow-up page, and it's giving "how long did the handshake actually take" energy. Like, SSL_get_handshake_rtt β€” yes, the OpenSSL 3.5.6 girlies on 2026-04-07 said let's measure the vibes. ✨


✨ NAME ✨

SSL_get_handshake_rtt β€” get the round trip time for the SSL Handshake. yes, literally that. 🫢


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so SSL_get_handshake_rtt() retrieves the round-trip time (RTT) for the SSL connection s. it's the main character metric, genuinely.

the RTT is represented in microseconds (us) as a uint64_t data type. tiny units, big drama. 😭


πŸ’– NOTES πŸ’–

how is this number even born? bestie, it's two timestamps taken during the handshake, and then the difference between those two times. that's it, that's the whole recipe. πŸŽ€

when you're the server:

  • timestamp #1 goes down when the server is finished writing to the client β€” during the ServerFinished in TLS 1.3, and ServerHelloDone in TLS 1.2.
  • timestamp #2 goes down when the server is done reading the client's response β€” which is after the client has responded with ClientFinished.

when you're the client:

  • timestamp #1 goes down when the client is finished writing the ClientHello and early data (if any).
  • timestamp #2 goes down when the client is done reading the server's response β€” after ServerFinished in TLS 1.3 and after ServerHelloDone in TLS 1.2.

now for the part that lowkey matters: in addition to network propagation delay and network stack overhead, this metric includes processing time on both endpoints. why? because it's based on TLS protocol-level messages, and the TLS protocol was not designed to measure network timings. no cap. so in some cases the processing time can be significant, especially when the processing includes asymmetric cryptographic operations. so like… don't treat this number as a pure network ping, okay? πŸ’…


πŸ‘‘ RETURN VALUES πŸ‘‘

  • returns 1 if the TLS handshake RTT is successfully retrieved β€” slay, we got it. ✨
  • returns 0 if the TLS handshake RTT cannot be determined yet β€” not yet, bestie, check back later. πŸ™ˆ
  • returns -1 if, while retrieving the TLS handshake RTT, an error occurs. πŸ’€

🌈 HISTORY 🌈

this function was added in OpenSSL 3.2. a whole era. ⭐


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

ok real talk, that license bit is not a suggestion β€” it says "you may not use this file except in compliance with the License", and she means it. 🫢

🧚 SEE ALSO 🧚

hmm, no SEE ALSO section on this page, so nothing to link out to β€” you're just here for the RTT and the vibes. πŸ“


and that's the whole page, bestie!! πŸ’– written up from the OpenSSL 3.5.6 docs, dated 2026-04-07, and it's still called SSL_GET_HANDSHAKE_RTT(3ossl) because we keep the manual name iconic. go measure some handshakes, you've got this. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from