[PATCH 06/12] http-curl: improve log messages.

greearb at candelatech.com greearb at candelatech.com
Thu Mar 26 17:39:52 EDT 2015


From: Ben Greear <greearb at candelatech.com>

Helps to track down why some problems relating to certs can
happen.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 src/utils/http_curl.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/utils/http_curl.c b/src/utils/http_curl.c
index b38cf79..33add62 100644
--- a/src/utils/http_curl.c
+++ b/src/utils/http_curl.c
@@ -855,8 +855,10 @@ static int validate_server_cert(struct http_ctx *ctx, X509 *cert)
 	struct http_cert hcert;
 	int ret;
 
-	if (ctx->cert_cb == NULL)
+	if (ctx->cert_cb == NULL) {
+		wpa_printf(MSG_INFO, "validate-server-cert, cert_cb is NULL!");
 		return 0;
+        }
 
 	if (0) {
 		BIO *out;
@@ -950,7 +952,7 @@ static int curl_cb_ssl_verify(int preverify_ok, X509_STORE_CTX *x509_ctx)
 	ssl_ctx = ssl->ctx;
 	ctx = SSL_CTX_get_app_data(ssl_ctx);
 
-	wpa_printf(MSG_DEBUG, "curl_cb_ssl_verify");
+	wpa_printf(MSG_INFO, "curl_cb_ssl_verify, preverify_ok: %d", preverify_ok);
 
 	err = X509_STORE_CTX_get_error(x509_ctx);
 	err_str = X509_verify_cert_error_string(err);
@@ -1251,7 +1253,14 @@ static CURL * setup_curl_post(struct http_ctx *ctx, const char *address,
 	CURL *curl;
 
 	wpa_printf(MSG_DEBUG, "Start HTTP client: address=%s ca_fname=%s "
-		   "username=%s", address, ca_fname, username);
+		   "username=%s  TLS-OPENSSL: %s",
+                   address, ca_fname, username,
+#ifdef EAP_TLS_OPENSSL
+                   "YES"
+#else
+                   "NO"
+#endif
+          );
 
 	curl = curl_easy_init();
 	if (curl == NULL)
-- 
1.9.3



More information about the HostAP mailing list