Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"openssh key type: ecdsa-sha2-nistp256 is not supported" ? #1144

Closed
deanparkr opened this issue Jun 15, 2023 · 2 comments
Closed

"openssh key type: ecdsa-sha2-nistp256 is not supported" ? #1144

deanparkr opened this issue Jun 15, 2023 · 2 comments
Milestone

Comments

@deanparkr
Copy link

I am using this package to connect to an SFTP server with SSH key. Looking at the package homepage it says under supported host key algorithms that it supports "ecdsa-sha2-nistp256"

However when I use the latest version of this package and connect to an SFTP server using a ecdsa-sha2-nistp256 OpenSSH private key, I get this message:

openssh key type: ecdsa-sha2-nistp256 is not supported

Have I missed something in my understanding here? Should this be supported as according to the package description or is it because of "openssh" type that it is not supported?

 using (var stream = assembly.GetManifestResourceStream(resourceName))
                {
                    if (stream == null)
                    {
                        throw new InvalidOperationException($"Resource '{resourceName}' not found.");
                    }
                    using (var keyFile = new PrivateKeyFile(stream, keyFilePassphrase))
                    {
                        var keyFiles = new[] { keyFile };
                        var methods = new List<AuthenticationMethod> { new PrivateKeyAuthenticationMethod(FTPUsername, keyFiles) };

                        var conInfo = new ConnectionInfo(FTPServer, FTPUsername, methods.ToArray());

                        using (var client = new SftpClient(conInfo))
                        {
                        client.Connect();
                        ....
                        ....
                        ....
@deanparkr
Copy link
Author

I managed to get it working with this build:

#1098

With thanks to @DavisNT !

@Rob-Hague
Copy link
Collaborator

Fixed by #614 which is in version 2023.0.0

@WojciechNagorski WojciechNagorski added this to the 2023.0.0 milestone Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants