rlm_rest_handle_t *randle = handle;
CURL *candle = randle->handle;
- long last_socket;
CURLcode ret;
- ret = curl_easy_getinfo(candle, CURLINFO_LASTSOCKET, &last_socket);
+#if CURL_AT_LEAST_VERSION(7,45,0)
+ curl_socket_t socket;
+ ret = curl_easy_getinfo(candle, CURLINFO_ACTIVESOCKET, &socket);
+#else
+ long socket;
+ ret = curl_easy_getinfo(candle, CURLINFO_LASTSOCKET, &socket);
+#endif
if (ret != CURLE_OK) {
ERROR("rlm_rest (%s): Couldn't determine socket state: %i - %s", inst->xlat_name, ret,
curl_easy_strerror(ret));
return false;
}
- if (last_socket == -1) {
+ if (socket == -1) {
return false;
}
SET_OPTION(CURLOPT_CAPATH, section->tls_ca_path);
}
+#if !CURL_AT_LEAST_VERSION(7,84,0)
if (section->tls_random_file) {
SET_OPTION(CURLOPT_RANDOM_FILE, section->tls_random_file);
}
+#endif
SET_OPTION(CURLOPT_SSL_VERIFYPEER, (section->tls_check_cert == true) ? 1 : 0);
SET_OPTION(CURLOPT_SSL_VERIFYHOST, (section->tls_check_cert_cn == true) ? 2 : 0);