]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Add disabled debug functions for GnuTLS.
authorSimon Ruderich <simon@ruderich.org>
Tue, 6 Aug 2013 04:16:15 +0000 (06:16 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 6 Aug 2013 04:16:15 +0000 (06:16 +0200)
src/tlsproxy.c
tests/client.c

index cfd240f3569a1460f7f11badb0690c9f0294bb00..b4beceaa2cd25f115196fad43a5737754494aa09 100644 (file)
@@ -364,6 +364,13 @@ static void print_usage(const char *argv) {
     fprintf(stderr, "   WARNING: might be a security problem!\n");
 }
 
+#if 0
+static void log_function_gnutls(int level, const char *string) {
+    (void)level;
+    fprintf(stderr, "    => %s", string);
+}
+#endif
+
 static void initialize_gnutls(void) {
     int result;
 /* Recent versions of GnuTLS automatically initialize the cryptography layer
@@ -391,6 +398,11 @@ static void initialize_gnutls(void) {
     result = gnutls_global_init();
     GNUTLS_ERROR_EXIT(result, "gnutls_global_init()");
 
+#if 0
+    gnutls_global_set_log_level(10);
+    gnutls_global_set_log_function(log_function_gnutls);
+#endif
+
     /* Setup GnuTLS cipher suites. */
     result = gnutls_priority_init(&global_tls_priority_cache, "NORMAL", NULL);
     GNUTLS_ERROR_EXIT(result, "gnutls_priority_init()");
index 41ddf5d1a3a2573de54a85e901f533ca42e08dd1..028189a24d44843c932955c5bcf0b6a6addc5975 100644 (file)
@@ -39,6 +39,12 @@ static int fdopen_read_write(int socket, FILE **read_fd, FILE **write_fd);
 static int connect_to_host(const char *hostname, const char *port);
 static int read_http_request(FILE *client_fd, char *request, size_t length);
 
+#if 0
+static void log_function_gnutls(int level, const char *string) {
+    (void)level;
+    fprintf(stderr, "    => %s", string);
+}
+#endif
 
 int main (int argc, char *argv[]) {
     int result, response;
@@ -65,6 +71,11 @@ int main (int argc, char *argv[]) {
     gnutls_global_init();
     gnutls_certificate_allocate_credentials(&xcred);
 
+#if 0
+    gnutls_global_set_log_level(10);
+    gnutls_global_set_log_function(log_function_gnutls);
+#endif
+
     gnutls_certificate_set_x509_trust_file(xcred,
                                            argv[1], GNUTLS_X509_FMT_PEM);