summaryrefslogtreecommitdiff
path: root/src/cli-debug.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-10-16 22:58:54 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-10-16 22:58:54 +0200
commitc0b286b28992dc10bc4a9cf343b54af0526e4de0 (patch)
tree57e4a3171474419e6a101298eaecffbb328bc3f6 /src/cli-debug.c
parent333d98ed59babd8b3a3834cc92686b905ad0dd4b (diff)
downloadgnutls-c0b286b28992dc10bc4a9cf343b54af0526e4de0.tar.gz
tools: when the starttls-proto is specified automatically detect the port if not given
Diffstat (limited to 'src/cli-debug.c')
-rw-r--r--src/cli-debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cli-debug.c b/src/cli-debug.c
index 35e4d0634a..8cc98fae94 100644
--- a/src/cli-debug.c
+++ b/src/cli-debug.c
@@ -339,8 +339,12 @@ static void cmd_parser(int argc, char **argv)
if (HAVE_OPT(PORT))
port = OPT_VALUE_PORT;
- else
- port = 443;
+ else {
+ if (HAVE_OPT(APP_PROTO))
+ port = starttls_proto_to_port(OPT_ARG(STARTTLS_PROTO));
+ else
+ port = 443;
+ }
if (rest == NULL)
hostname = "localhost";