CURLINFO_APPCONNECT_TIME(3)

πŸ’… CURLINFO_APPCONNECT_TIME(3) ✨

okay so this is a page from the Library Functions Manual bestie, and it's about CURLINFO_APPCONNECT_TIME β€” the one that tells you how long the SSL/SSH handshake took. let's get into it 🫢


🌸 NAME 🌸

CURLINFO_APPCONNECT_TIME β€” literally the time until the SSL/SSH handshake is completed πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME,
                           double *timep);

πŸ¦‹ DESCRIPTION πŸ¦‹

so you pass a pointer to a double, right? and it gets filled with the time β€” in seconds β€” that it took from the very start until the SSL/SSH connect/handshake to the remote host was all done and dusted. slay.

most of the time this number is close to the CURLINFO_PRETRANSFER_TIME(3) time, except in cases like HTTP multiplexing where the pretransfer time can get delayed from waits in line for the stream and more. like, that one's just stuck in traffic, not you. πŸ’€

when a redirect is followed, the time from each request is added together. no cap, it stacks. πŸ”₯

also go peek at the TIMES overview in the curl_easy_getinfo(3) man page, it's giving whole-timeline energy πŸ‘‘

🌈 PROTOCOLS 🌈

this functionality affects all supported protocols ✨ periodt, all of them.


πŸ“ EXAMPLE πŸ“

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    double connect;
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
    result = curl_easy_perform(curl);
    if(CURLE_OK == result) {
      result = curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &connect);
      if(CURLE_OK == result) {
        printf("Time: %.1f", connect);
      }
    }
    /* always cleanup */
    curl_easy_cleanup(curl);
  }
}

like look at it go β€” connect, get the info, print it, clean up. main character energy the whole way through πŸ‘‘


⭐ AVAILABILITY ⭐

added in curl 7.19.0 β€” she's been iconic since day one, iykyk πŸ’œ


πŸ’€ RETURN VALUE πŸ’€

curl_easy_getinfo(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK 😌 β€” non-zero means an error occurred, so go see libcurl-errors(3) for the tea πŸ™ˆ


🧚 SEE ALSO 🧚


and that's the whole vibe bestie πŸ’– this page is from libcurl, dated 2026-10-12, and you can quote me on that β€” CURLINFO_APPCONNECT_TIME(3) out πŸŽ€βœ¨

πŸ“¦ where this page comes from