1
.\" Copyright (C) The libssh2 project and its contributors.
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_session_method_pref 3 "1 Jun 2007" "libssh2 0.15" "libssh2"
5
libssh2_session_method_pref - set preferred key exchange method
11
libssh2_session_method_pref(LIBSSH2_SESSION *session,
12
int method_type, const char *prefs);
15
\fIsession\fP - Session instance as returned by
16
.BR libssh2_session_init_ex(3)
18
\fImethod_type\fP - One of the Method Type constants.
20
\fIprefs\fP - Coma delimited list of preferred methods to use with
21
the most preferred listed first and the least preferred listed last.
22
If a method is listed which is not supported by libssh2 it will be
23
ignored and not sent to the remote host during protocol negotiation.
25
Set preferred methods to be negotiated. These
26
preferences must be set prior to calling
27
.BR libssh2_session_handshake(3)
28
as they are used during the protocol initiation phase.
30
Return 0 on success or negative on failure. It returns
31
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
32
LIBSSH2_ERROR_EAGAIN is a negative number, it is not really a failure per se.
34
\fILIBSSH2_ERROR_INVAL\fP - The requested method type was invalid.
36
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
38
\fILIBSSH2_ERROR_METHOD_NOT_SUPPORTED\fP - The requested method is not supported.
40
.BR libssh2_session_init_ex(3)
41
.BR libssh2_session_handshake(3)