]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
squidclient: link GnuTLS library debug to -v level display
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 27 Jan 2017 00:37:07 +0000 (13:37 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 27 Jan 2017 00:37:07 +0000 (13:37 +1300)
tools/squidclient/Transport.cc

index 43923a6e638c7937ebf8aad53d4190b4a01c806e..a388714bb964f7799ad6f291607769d632a293ea 100644 (file)
@@ -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);