commit 97051da883daf5b16e59487cb01fdf6717ecaf45
parent 264ab685babcf387add1b9d9492d3b5bfc563c21
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Thu, 19 Mar 2020 22:12:18 +0100
eap-tls: Print a hint about IWD_TLS_DEBUG on TLS errors
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/eap-tls-common.c b/src/eap-tls-common.c
@@ -255,6 +255,13 @@ static void eap_tls_tunnel_ready(const char *peer_identity, void *user_data)
l_tls_close(eap_tls->tunnel);
}
+static void eap_tls_debug_hint(void)
+{
+ if (!getenv("IWD_TLS_DEBUG"))
+ l_debug("set the IWD_TLS_DEBUG environment variable to see "
+ "more information");
+}
+
static void eap_tls_tunnel_disconnected(enum l_tls_alert_desc reason,
bool remote, void *user_data)
{
@@ -592,6 +599,7 @@ static bool eap_tls_tunnel_init(struct eap_state *eap)
l_error("%s: Failed to set auth data.",
eap_get_method_name(eap));
+ eap_tls_debug_hint();
return false;
}
@@ -606,6 +614,7 @@ static bool eap_tls_tunnel_init(struct eap_state *eap)
eap_tls->ca_cert = NULL;
l_error("%s: Error settings CA certificates.",
eap_get_method_name(eap));
+ eap_tls_debug_hint();
return false;
}
@@ -618,6 +627,7 @@ static bool eap_tls_tunnel_init(struct eap_state *eap)
if (!l_tls_start(eap_tls->tunnel)) {
l_error("%s: Failed to start the TLS client",
eap_get_method_name(eap));
+ eap_tls_debug_hint();
return false;
}