diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-08-22 08:46:04 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-08-22 11:27:37 +0200 |
commit | 3ce7bc7b7d0a0daded5bd5a338b8361e5ac755f5 (patch) | |
tree | 34c4c54e15d6daec2af2447f49ad3de4e2249114 /src/cli.c | |
parent | 39cdaed454b12c7be9881d550ec2ea89c649c707 (diff) | |
download | gnutls-3ce7bc7b7d0a0daded5bd5a338b8361e5ac755f5.tar.gz |
gnutls-cli: fixed the behavior when --starttls or --starttls-proto is given
The change of moving the handshake process as part of the socket establishment
broke the starttls functionality in gnutls-cli. This change fixes that functionality.
Reported by Andreas Metzler.
Diffstat (limited to 'src/cli.c')
-rw-r--r-- | src/cli.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1212,19 +1212,25 @@ int main(int argc, char **argv) socket_flags |= SOCKET_FLAG_UDP; if (fastopen) socket_flags |= SOCKET_FLAG_FASTOPEN; + if (verbose) + socket_flags |= SOCKET_FLAG_VERBOSE; if (starttls) + socket_flags |= SOCKET_FLAG_RAW; + else if (HAVE_OPT(STARTTLS_PROTO)) socket_flags |= SOCKET_FLAG_STARTTLS; socket_open(&hd, hostname, service, OPT_ARG(STARTTLS_PROTO), socket_flags, CONNECT_MSG, NULL); hd.verbose = verbose; - printf("- Handshake was completed\n"); + if (hd.secure) { + printf("- Handshake was completed\n"); - if (resume != 0) - if (try_resume(&hd)) - return 1; + if (resume != 0) + if (try_resume(&hd)) + return 1; - print_other_info(hd.session); + print_other_info(hd.session); + } /* Warning! Do not touch this text string, it is used by external programs to search for when gnutls-cli has reached this point. */ |