[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ssh_connect issue "Couldn't apply options"
[Thread Prev] | [Thread Next]
- Subject: Re: ssh_connect issue "Couldn't apply options"
- From: g4-lisz@xxxxxxxxxxxx
- Reply-to: libssh@xxxxxxxxxx
- Date: Tue, 9 Apr 2019 13:48:00 +0200
- To: libssh@xxxxxxxxxx
On 08.04.19 15:31, Karlen Abrahamyan wrote:
> Hi. I have previously used libssh version 0.7.2 on Windows and it
> worked just fine, wanted to switch to new version 0.8.7 but I keep
> getting "Couldn't apply options" error message on ssh_connect func
> call and cant find any help in other threads.
>
> Here is my code
>
> sshSession = ssh_new();
> if (sshSession == NULL)
> exit(-1);
>
> int port = 22;
> ssh_options_set(sshSession, SSH_OPTIONS_HOST, "192.168.0.109");
> ssh_options_set(sshSession, SSH_OPTIONS_PORT, &port);
> int rc = ssh_connect(sshSession);
> if (rc != SSH_OK)
> {
> // here I keep getting the error I mentioned above
> ssh_free(sshSession);
> }
>
> This exact code worked in 0.7.2 version on Windows. Any help would be
> much appreciated. Thank you in advance.
Did you compile the lib yourself? If yes, you could try to isolate the
issue by adding some debug messages in src/options.c on each line where
-1 is returned in ssh_options_apply():
int ssh_options_apply(ssh_session session) {
[...]
--> ssh_set_error(session,SSH_FATAL,"Trying to XY failed"); <---
return -1;
[...]
}
This is called by ssh_connect(). And when it returns -1, the message
"Couldn't apply options" is printed.
Cheers,
Till
| Re: ssh_connect issue "Couldn't apply options" | Karlen Abrahamyan <abkarlen@xxxxxxxxx> |
| ssh_connect issue "Couldn't apply options" | Karlen Abrahamyan <abkarlen@xxxxxxxxx> |