diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-07 18:30:17 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-07 18:30:17 +0100 |
commit | ba1005c5e613297c24191e36c4300a96f91c0082 (patch) | |
tree | afc7a9bf089c0de2895da3a8c40fe06d5820e091 /src | |
parent | e2846b70577244b83550edbf3104582300148b3c (diff) | |
download | gnutls-ba1005c5e613297c24191e36c4300a96f91c0082.tar.gz |
gnutls-cli-debug uses server name indication.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/cli-debug.c (renamed from src/tls_test.c) | 9 |
2 files changed, 9 insertions, 2 deletions
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 index f4f61b1a6f..2cd2203edc 100644 --- a/src/tls_test.c +++ b/src/cli-debug.c @@ -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 { |