How to programmatically create ssh tunnel in C/C++ cross-platform? How to programmatically create ssh tunnel in C/C++ cross-platform? windows windows

How to programmatically create ssh tunnel in C/C++ cross-platform?


But libssh2 is BSD-licensed and appears to have the functionality needed

Looks like: libssh2_channel_direct_tcpip_ex will be the call

Note that the LGPL'd libssh is a problem because on iOS apps you MUST statically link and CANNOT dynamically link to libraries. Therefore, using an LGPL'd library means my source becomes open source.


Libssh is a very good client implementation for SSH protocol. I have written a blog on this. There is also a sample application demonstrating the same. We use the same technique in MONyog (MySQL monitor).


There is a commercial LIB if you want to have a look at, www.chilkatsoft.com/, it is a genric C++ lib for all languages, in it there is a support for SSH tunneling for IOS.