如何用OpenSSL在C++Curl中测量握手时间

How to measure time of handshake in C++ Curl with OpenSSL?

本文关键字:测量 时间 C++Curl 何用 OpenSSL      更新时间:2023-10-16

我有一些卷曲的选项:

curl_easy_setopt(curl_, CURLOPT_SSL_VERIFYHOST, 1;
curl_easy_setopt(curl_, CURLOPT_SSL_VERIFYPEER, 1);
curl_easy_setopt(curl_, CURLOPT_SSL_CTX_DATA, this);
curl_easy_setopt(curl_, CURLOPT_SSL_CTX_FUNCTION, SslContextFunction);
...

当握手结束时,如何从curl获得回调?

由于您使用的是OpenSSL,因此在调用SslContextFunction时,请使用SSL_CTX_set_info_callback为SSL上下文中发生的各种事件建立回调。其中一个事件将是SSL_CB_HANDSHAKE_DONE