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
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms