From: Amos Jeffries Date: Sat, 14 Jan 2017 11:30:02 +0000 (+1300) Subject: squidclient: link GnuTLS library debug to -v level display X-Git-Tag: M-staged-PR71~307 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db083a7bb8f8dbc85c16fc521d4c9a9b96b9438;p=thirdparty%2Fsquid.git 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);