SSL_GET_HANDSHAKE_RTT(3ossl)
π 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
ServerFinishedin TLS 1.3, andServerHelloDonein 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
ClientHelloand early data (if any). - timestamp #2 goes down when the client is done reading the server's response β after
ServerFinishedin TLS 1.3 and afterServerHelloDonein 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
1if the TLS handshake RTT is successfully retrieved β slay, we got it. β¨ - returns
0if the TLS handshake RTT cannot be determined yet β not yet, bestie, check back later. π - returns
-1if, while retrieving the TLS handshake RTT, an error occurs. π
π HISTORY π
this function was added in OpenSSL 3.2. a whole era. β
π COPYRIGHT π
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
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms