- Introducing CURLOPT_CERTINFO and the corresponding CURLINFO_CERTINFO. By
enabling this feature with CURLOPT_CERTINFO for a request using SSL (HTTPS or FTPS), libcurl will gather lots of server certificate info and that info can then get extracted by a client after the request has completed with curl_easy_getinfo()'s CURLINFO_CERTINFO option. Linus Nielsen Feltzing helped me test and smoothen out this feature. Unfortunately, this feature currently only works with libcurl built to use OpenSSL. This feature was sponsored by networking4all.com - thanks!
This commit is contained in:
12
lib/sslgen.c
12
lib/sslgen.c
@@ -465,3 +465,15 @@ bool Curl_ssl_data_pending(const struct connectdata *conn,
|
||||
}
|
||||
#endif /* USE_SSL */
|
||||
|
||||
void Curl_ssl_free_certinfo(struct SessionHandle *data)
|
||||
{
|
||||
int i;
|
||||
struct curl_certinfo *ci = &data->info.certs;
|
||||
if(ci->num_of_certs) {
|
||||
/* free all individual lists used */
|
||||
for(i=0; i<ci->num_of_certs; i++)
|
||||
curl_slist_free_all(ci->certinfo[i]);
|
||||
free(ci->certinfo); /* free the actual array too */
|
||||
ci->num_of_certs = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user