sftp: Error“internal inconsistency” in downloading file from special sftp server whish is old cipher

  • When testing sftp,appear this: “ssh: handshake failed: ssh: no common algorithm for client to server cipher; client offered: [aes128-gcm@openssh.com chacha20-poly1305@openssh.com aes128-ctr aes192-ctr aes256-ctr], server offered: [aes128-cbc 3des-cbc blowfish-cbc]”

  • So, i add Ciphers to the clientConfig below, success to new sftp.Client ` auth := make([]ssh.AuthMethod, 0) auth = append(auth, ssh.Password(sftpOrFtpUrlInfo.Password)) var sshconfig ssh.Config sshconfig.SetDefaults() cipherOrder := sshconfig.Ciphers sshconfig.Ciphers = append(cipherOrder, “aes128-cbc”, “3des-cbc”, “blowfish-cbc”) clientConfig := ssh.ClientConfig{ Config: sshconfig, User: sftpOrFtpUrlInfo.Username, Auth: auth, Timeout: 5 * time.Second, HostKeyCallback: ssh.InsecureIgnoreHostKey(), }

    addr := iptools.BuildAddr(sftpOrFtpUrlInfo.Ip, sftpOrFtpUrlInfo.Port) client, err := ssh.Dial(“tcp”, addr, &clientConfig)`

  • but, Error “internal inconsistency” from WriteTo(dstFile) in downloading file from the sftp server.

  • In fact, it is working from other sftp server.

Is there a way to solve this problem? Looking forward to your reply.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 22 (12 by maintainers)

Commits related to this issue

Most upvoted comments

To rephrase to make sure I understand…

You have a newer SFTP server that supports the newer ciphers and an older SFTP server that doesn’t. The one where you can use the new, default ciphers works but the old one where you must configure it to use different ciphers doesn’t.

Does that sound right?