From: Amos Jeffries Date: Fri, 27 Jan 2017 00:37:07 +0000 (+1300) Subject: squidclient: link GnuTLS library debug to -v level display X-Git-Tag: SQUID_4_0_18~12 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fsquid.git;a=commitdiff_plain;h=9467c0b044c11d57d2cba189d4e9ffd7e709d467 squidclient: link GnuTLS library debug to -v level display --- diff --git a/tools/squidclient/Transport.cc b/tools/squidclient/Transport.cc index 43923a6e63..a388714bb9 100644 --- a/tools/squidclient/Transport.cc +++ b/tools/squidclient/Transport.cc @@ -341,6 +341,14 @@ verifyTlsCertificate(gnutls_session_t session) } #endif +#if USE_GNUTLS +static void +gnutlsDebugHandler(int level, const char *msg) +{ + debugVerbose(level, "GnuTLS: " << msg); +} +#endif + void Transport::InitTls() { @@ -355,6 +363,11 @@ Transport::InitTls() Config.tlsEnabled = true; +#if USE_GNUTLS + gnutls_global_set_log_function(&gnutlsDebugHandler); + gnutls_global_set_log_level(scParams.verbosityLevel); +#endif + // Initialize for anonymous TLS gnutls_anon_allocate_client_credentials(&Config.anonCredentials);