From 03986f1b8b62483da55432fe2b63d0e3d4df2771 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 30 Jul 2008 21:24:19 +0000 Subject: [PATCH] - Made the curl tool's -w option support the %{ssl_verify_result} variable --- docs/curl.1 | 4 ++++ src/writeout.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/docs/curl.1 b/docs/curl.1 index 3af6bda..a87e1cc 100644 --- a/docs/curl.1 +++ b/docs/curl.1 @@ -1303,6 +1303,10 @@ will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2) .B ftp_entry_path The initial path libcurl ended up in when logging on to the remote FTP server. (Added in 7.15.4) +.TP +.B ssl_verify_result +The result of the SSL peer certificate verification that was requested. 0 +means the verification was successful. (Added in 7.19.0) .RE If this option is used several times, the last one will be used. diff --git a/src/writeout.c b/src/writeout.c index 1e77d06..4f94bab 100644 --- a/src/writeout.c +++ b/src/writeout.c @@ -63,6 +63,7 @@ typedef enum { VAR_REDIRECT_COUNT, VAR_FTP_ENTRY_PATH, VAR_REDIRECT_URL, + VAR_SSL_VERIFY_RESULT, VAR_NUM_OF_VARS /* must be the last */ } replaceid; @@ -95,6 +96,7 @@ static const struct variable replacements[]={ {"num_redirects", VAR_REDIRECT_COUNT}, {"ftp_entry_path", VAR_FTP_ENTRY_PATH}, {"redirect_url", VAR_REDIRECT_URL}, + {"ssl_verify_result", VAR_SSL_VERIFY_RESULT}, {NULL, VAR_NONE} }; @@ -241,6 +243,11 @@ void ourWriteOut(CURL *curl, const char *writeinfo) && stringp) fputs(stringp, stream); break; + case VAR_SSL_VERIFY_RESULT: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &longinfo)) + fprintf(stream, "%ld", longinfo); + break; default: break; } -- 2.7.4