From 6cba487395e79775482fc80dcbc4146e3b17c773 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 8 Dec 2022 18:11:54 -0800 Subject: [PATCH] Enable trace debugging in example/ssh2 This is intended to be a test program, so debugging is likely to be useful by default. --- example/ssh2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/example/ssh2.c b/example/ssh2.c index efb245fe..b8d32091 100644 --- a/example/ssh2.c +++ b/example/ssh2.c @@ -133,6 +133,19 @@ int main(int argc, char *argv[]) * banners, exchange keys, and setup crypto, compression, and MAC layers */ session = libssh2_session_init(); + /* Enable all debugging when libssh2 was built with debugging enabled */ + libssh2_trace(session, + LIBSSH2_TRACE_TRANS | + LIBSSH2_TRACE_KEX | + LIBSSH2_TRACE_AUTH | + LIBSSH2_TRACE_CONN | + LIBSSH2_TRACE_SCP | + LIBSSH2_TRACE_SFTP | + LIBSSH2_TRACE_ERROR | + LIBSSH2_TRACE_PUBLICKEY | + LIBSSH2_TRACE_SOCKET + ); + if(libssh2_session_handshake(session, sock)) { fprintf(stderr, "Failure establishing SSH session\n"); return -1;