SSH.NET Data longer than 2147483647 is not supported while connecting to mainframe

414 Views Asked by At

I'm having a problem when I try to connect to mainframe using SSH.NET.

Some times that I try to connect to mainframe, give me the error:

Data longer than 2147483647 is not supported. It does not occur all the time, but sometime this error shows up.

Do you guys have any idea of what is this?

Here's how I'm connection to the server.

I'm using SSH.NET with a public/private key pairs SSH 2048 which was generated by PuTTYgen:

Dim keystrm As MemoryStream = New MemoryStream(Encoding.ASCII.GetBytes(PASSWORD))
Dim privateKey = New Renci.SshNet.PrivateKeyFile(keystrm, PassPhrase)
Dim keyFiles As Renci.SshNet.PrivateKeyFile() = {privateKey}
Dim methods As List(Of Renci.SshNet.AuthenticationMethod) =
    New List(Of Renci.SshNet.AuthenticationMethod)()
methods.Add(New Renci.SshNet.PrivateKeyAuthenticationMethod(USER, keyFiles))
Dim con = New Renci.SshNet.ConnectionInfo(SERVER, 222, USER, methods.ToArray())

Using client As New Renci.SshNet.SftpClient(con)
    client.Connect()

    client.UploadFile(stream, aux)
End Using
1

There are 1 best solutions below

0
On

Most likely the server (randomly) prints some message, thus violates SFTP protocol. Had you tried any standalone SFTP client at the same moment, you should not be able to connect either.

The same problem for other libraries/clients: