Unable to connect to a server using 2024.2.0: Key exchange negotiation failed
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- csharp, fsharp
- Área
- backend, networking, security
Línea de trabajo
Comience con los puntos de entrada KeyExchangeECCurve25519 y Session mostrados en la excepción, comparando el comportamiento entre SSH.NET 2024.1.0 y 2024.2.0. Reproduzca el fallo usando /home/vmadmin/temp/print-sftp-files.fsx con la clave ed25519 codificada en base64; se considerará terminado cuando el ejemplo se conecte y muestre el directorio solicitado como lo hacía con 2024.1.0.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Unable to connect to a server when using SSH.NET 2024.2.0 and base64-encoded ed25519 private key. Version 2024.1.0 works fine.
This is the exception I'm getting:
Renci.SshNet.Common.SshConnectionException: Key exchange negotiation failed.
at Renci.SshNet.Security.KeyExchange.Finish()
at Renci.SshNet.Security.KeyExchangeECCurve25519.Finish()
at Renci.SshNet.Security.KeyExchangeECCurve25519.Session_KeyExchangeEcdhReplyMessageReceived(Object sender, MessageEventArgs`1 e)
at Renci.SshNet.Session.OnKeyExchangeEcdhReplyMessageReceived(KeyExchangeEcdhReplyMessage message)
at Renci.SshNet.Messages.Transport.KeyExchangeEcdhReplyMessage.Process(Session session)
at Renci.SshNet.Session.MessageListener()
--- End of stack trace from previous location ---
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout)
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.CreateAndConnectSession()
at Renci.SshNet.BaseClient.Connect()
at FSI_0002.main(String host, String user, String dir) in /home/vmadmin/temp/print-sftp-files.fsx:line 22
at <StartupCode$FSI_0002>.$FSI_0002.main@() in /home/vmadmin/temp/print-sftp-files.fsx:line 30
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Stopped due to error
Here's my code:
#r "nuget: SSH.NET, 2024.2.0"
open Renci.SshNet
open System
open System.IO
let getAuthMethod (user : string) : AuthenticationMethod =
let key = Environment.GetEnvironmentVariable "SSH_KEY"
let pwd = Environment.GetEnvironmentVariable "SSH_PWD"
if not (String.IsNullOrEmpty key) then
new PrivateKeyAuthenticationMethod(user, new PrivateKeyFile(new MemoryStream(Convert.FromBase64String key)))
else if not (String.IsNullOrEmpty pwd) then
new PasswordAuthenticationMethod(user, pwd)
else
failwith "Environment variable SSH_PWD or SSH_KEY must be defined"
let main host user (dir: string) =
let auth = getAuthMethod user
use client = new SftpClient(new ConnectionInfo(host, user, auth))
client.Connect()
let res = client.ListDirectory dir
for item in res do
printfn "%s" item.FullName
match fsi.CommandLineArgs |> List.ofArray with
| [ _; host; user; dir ] -> main host user dir
| _ -> printfn "Usage: dotnet fsi %s <host> <user> <dir>" fsi.CommandLineArgs.[0]
- Lenguaje dominante
- C#
- Estrellas
- 4.4k
- Forks
- 993
- Merge medio
- 9 d 21 h
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sshnet/SSH.NET
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Using SshClient on Linux under Wine throws System.Security.Cryptography.CryptographicException Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Todos los issues de sshnet/SSH.NET
Issues similares
-
bug needs response
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
difficulty/starter 🚀 good first issue kind/bug platform/ios 🍎 project/non-ui ⚙️ triage/untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
unoplatform/uno#24650 ·
-
area-ai untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/extensions#7783 ·
-
untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
dotnet/dotnet-api-docs#13095 ·