aboutsummaryrefslogtreecommitdiffstats
path: root/apps/s_client.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-09-12 23:14:28 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-09-12 23:14:28 +0000
commit2a7cbe77b3abb244c2211d22d7aa3416b97c9342 (patch)
tree6fac05021a386f88a82694976dfc4f504fafba9f /apps/s_client.c
parent94a209d8e1ef9cc0a26ff16e5419b198fdfa5adc (diff)
downloadopenssl-2a7cbe77b3abb244c2211d22d7aa3416b97c9342.tar.gz
Add -brief option to s_client and s_server to summarise connection details.
New option -verify_quiet to shut up the verify callback unless there is an error.
Diffstat (limited to 'apps/s_client.c')
-rw-r--r--apps/s_client.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index ea0a3216a9..a7b150b02a 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -193,6 +193,7 @@ typedef unsigned int u_int;
extern int verify_depth;
extern int verify_error;
extern int verify_return_error;
+extern int verify_quiet;
#ifdef FIONBIO
static int c_nbio=0;
@@ -220,6 +221,7 @@ static BIO *bio_c_out=NULL;
static BIO *bio_c_msg=NULL;
static int c_quiet=0;
static int c_ign_eof=0;
+static int c_brief=0;
#ifndef OPENSSL_NO_PSK
/* Default PSK identity and key */
@@ -688,7 +690,8 @@ int MAIN(int argc, char **argv)
verify=SSL_VERIFY_PEER;
if (--argc < 1) goto bad;
verify_depth=atoi(*(++argv));
- BIO_printf(bio_err,"verify depth is %d\n",verify_depth);
+ if (!c_quiet)
+ BIO_printf(bio_err,"verify depth is %d\n",verify_depth);
}
else if (strcmp(*argv,"-cert") == 0)
{
@@ -718,6 +721,14 @@ int MAIN(int argc, char **argv)
}
else if (strcmp(*argv,"-verify_return_error") == 0)
verify_return_error = 1;
+ else if (strcmp(*argv,"-verify_quiet") == 0)
+ verify_quiet = 1;
+ else if (strcmp(*argv,"-brief") == 0)
+ {
+ c_brief = 1;
+ verify_quiet = 1;
+ c_quiet = 1;
+ }
else if (args_excert(&argv, &argc, &badarg, bio_err, &exc))
{
if (badarg)
@@ -1611,6 +1622,12 @@ SSL_set_tlsext_status_ids(con, ids);
else
BIO_printf(bio_err, "Error writing session file %s\n", sess_out);
}
+ if (c_brief)
+ {
+ BIO_puts(bio_err,
+ "CONNECTION ESTABLISHED\n");
+ print_ssl_summary(bio_err, con);
+ }
print_stuff(bio_c_out,con,full_log);
if (full_log > 0) full_log--;