0 votes
by (220 points)
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
{
    await client.ConnectAsync(host, port); // about 15 sec here
    await client.LoginAsync(username, new Rebex.Net.SshPrivateKey(stream)); // and 2 sec here
}

When I'm trying to connect it takes about 17 seconds to connect, with WinSCP it takes about 4. Is there is something that I can do?

Applies to: Rebex SFTP

1 Answer

+1 vote
by (144k points)
selected by
 
Best answer

By default, Rebex components on Xamarin.Android use a managed implementation of Diffie-Hellman key exchange algorithm which is quite slow. A faster version based on Android API is available, but it has to be references and enabled.

Please see the following KB article for instructions:
HOWTO: Fast Diffie-Hellman on Xamarin.Android

...