]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls-cli-debug uses server name indication.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 7 Nov 2012 17:30:17 +0000 (18:30 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 7 Nov 2012 17:30:17 +0000 (18:30 +0100)
src/Makefile.am
src/cli-debug.c [moved from src/tls_test.c with 97% similarity]

index 9935f0de111c713212a3ca2ceb1084372172f627..8f5a4b1ab685d4acb64c73c29a94dc0b5be2b858 100644 (file)
@@ -116,7 +116,7 @@ noinst_LTLIBRARIES += libcmd-cli.la
 libcmd_cli_la_CFLAGS = 
 libcmd_cli_la_SOURCES = cli-args.def cli-args.c cli-args.h
 
-gnutls_cli_debug_SOURCES = tls_test.c tests.h tests.c \
+gnutls_cli_debug_SOURCES = cli-debug.c tests.h tests.c \
                socket.c socket.h common.h common.c
 gnutls_cli_debug_LDADD = ../lib/libgnutls.la libcmd-cli-debug.la 
 gnutls_cli_debug_LDADD += ../gl/libgnu.la
similarity index 97%
rename from src/tls_test.c
rename to src/cli-debug.c
index f4f61b1a6fcc310b771dba29222629b0630402fa..2cd2203edc77690b272001011659537bd582afee 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 #include <tests.h>
 #include <common.h>
+#include <ctype.h>
 #include <cli-debug-args.h>
 #include <socket.h>
 
@@ -275,9 +276,15 @@ main (int argc, char **argv)
               continue;
             }
         }
-      ERR (err, "connect") gnutls_init (&state, GNUTLS_CLIENT|GNUTLS_NO_EXTENSIONS);
+      ERR (err, "connect");
+
+      gnutls_init (&state, GNUTLS_CLIENT|GNUTLS_NO_EXTENSIONS);
+
       gnutls_transport_set_ptr (state, (gnutls_transport_ptr_t)
                                 gl_fd_to_handle (sd));
+      if (hostname && !isdigit(hostname[0]) && strchr(hostname, ':') == 0)
+        gnutls_server_name_set (state, GNUTLS_NAME_DNS, hostname,
+                                strlen (hostname));
 
       do
         {