1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

Enable trace debugging in example/ssh2

This is intended to be a test program, so debugging is likely to be
useful by default.
This commit is contained in:
Dan Fandrich
2022-12-08 18:11:54 -08:00
committed by Dan Fandrich
parent d4062feb3d
commit 6cba487395

View File

@ -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;