libssh2\_session\_methods(3) libssh2 libssh2\_session\_methods(3)

# [NAME](#NAME)

libssh2\_session\_methods - return the currently active algorithms

# [SYNOPSIS](#SYNOPSIS)

```
#include <libssh2.h>
const char *
libssh2_session_methods(LIBSSH2_SESSION *session, int method_type);
```

# [DESCRIPTION](#DESCRIPTION)

*session* - Session instance as returned by [**libssh2\_session\_init\_ex(3)**](/man/os/libssh2/libssh2_session_init_ex.3)

*method\_type* - one of the method type constants: LIBSSH2\_METHOD\_KEX, LIBSSH2\_METHOD\_HOSTKEY, LIBSSH2\_METHOD\_CRYPT\_CS, LIBSSH2\_METHOD\_CRYPT\_SC, LIBSSH2\_METHOD\_MAC\_CS, LIBSSH2\_METHOD\_MAC\_SC, LIBSSH2\_METHOD\_COMP\_CS, LIBSSH2\_METHOD\_COMP\_SC, LIBSSH2\_METHOD\_LANG\_CS, LIBSSH2\_METHOD\_LANG\_SC, LIBSSH2\_METHOD\_SIGN\_ALGO.

Returns the actual method negotiated for a particular transport parameter.

# [RETURN VALUE](#RETURN_VALUE)

Negotiated method or NULL if the session has not yet been started.

# [ERRORS](#ERRORS)

*LIBSSH2\_ERROR\_INVAL* - The requested method type was invalid.

*LIBSSH2\_ERROR\_METHOD\_NONE* - no method has been set

# [SEE ALSO](#SEE_ALSO)

[**libssh2\_session\_init\_ex(3)**](/man/os/libssh2/libssh2_session_init_ex.3)

8 Nov 2021 libssh2 1.11

---

Document: libssh2_session_methods(3) from libssh2 1.11.1-r11 (Chainguard OS)
Source: https://github.com/libssh2/libssh2.git
