From: Nikos Mavrogiannopoulos Date: Wed, 7 Nov 2012 17:30:17 +0000 (+0100) Subject: gnutls-cli-debug uses server name indication. X-Git-Tag: gnutls_3_1_4~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba1005c5e613297c24191e36c4300a96f91c0082;p=thirdparty%2Fgnutls.git gnutls-cli-debug uses server name indication. --- diff --git a/src/Makefile.am b/src/Makefile.am index 9935f0de11..8f5a4b1ab6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/tls_test.c b/src/cli-debug.c similarity index 97% rename from src/tls_test.c rename to src/cli-debug.c index f4f61b1a6f..2cd2203edc 100644 --- a/src/tls_test.c +++ b/src/cli-debug.c @@ -33,6 +33,7 @@ #endif #include #include +#include #include #include @@ -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 {