diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-09-05 14:29:21 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-09-05 14:29:21 +0000 |
commit | 4c9768565ec3a9baf26ac8a547bca6e42cc64fa5 (patch) | |
tree | 9713affdba06e0ff43abe1f1bdb01bdc3b4cf5a7 /lib/sslgen.c | |
parent | 873e734c3971fd620c09bdc31c2e7e4cfc4a0a67 (diff) |
- 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!
Diffstat (limited to 'lib/sslgen.c')
-rw-r--r-- | lib/sslgen.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sslgen.c b/lib/sslgen.c index 0001cd8d3..df24fbdd4 100644 --- a/lib/sslgen.c +++ b/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; + } +} |