aboutsummaryrefslogtreecommitdiffstats
path: root/util/quicserver.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-08-17 14:32:53 +0100
committerMatt Caswell <matt@openssl.org>2023-08-24 10:33:58 +0100
commitf430713c8c5e579b513ffa16133b8c178978c5b6 (patch)
tree9e597d0d6f2e53b5a2d86eee79d15bd8b7560ef0 /util/quicserver.c
parentcb931288730d3ad3e3a6ad9a9db13a8180d31ed9 (diff)
downloadopenssl-f430713c8c5e579b513ffa16133b8c178978c5b6.tar.gz
Add a -trace option to quicserver to enable tracing of the communication
Trace output of the communication with the client is dumped to stderr if the -trace options is supplied Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21800)
Diffstat (limited to 'util/quicserver.c')
-rw-r--r--util/quicserver.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/util/quicserver.c b/util/quicserver.c
index 72f9fd9f57..25ac21691f 100644
--- a/util/quicserver.c
+++ b/util/quicserver.c
@@ -132,14 +132,14 @@ static BIO *create_dgram_bio(int family, const char *hostname, const char *port)
static void usage(void)
{
- BIO_printf(bio_err, "quicserver [-6] hostname port certfile keyfile\n");
+ BIO_printf(bio_err, "quicserver [-6][-trace] hostname port certfile keyfile\n");
}
int main(int argc, char *argv[])
{
QUIC_TSERVER_ARGS tserver_args = {0};
QUIC_TSERVER *qtserv = NULL;
- int ipv6 = 0;
+ int ipv6 = 0, trace = 0;
int argnext = 1;
BIO *bio = NULL;
char *hostname, *port, *certfile, *keyfile;
@@ -162,6 +162,8 @@ int main(int argc, char *argv[])
break;
if (strcmp(argv[argnext], "-6") == 0) {
ipv6 = 1;
+ } else if(strcmp(argv[argnext], "-trace") == 0) {
+ trace = 1;
} else {
BIO_printf(bio_err, "Unrecognised argument %s\n", argv[argnext]);
usage();
@@ -207,6 +209,9 @@ int main(int argc, char *argv[])
/* Ownership of the BIO is passed to qtserv */
bio = NULL;
+ if (trace)
+ ossl_quic_tserver_set_msg_callback(qtserv, SSL_trace, bio_err);
+
/* Read the request */
do {
if (first)