-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
An exception about "The credentials supplied to the package were not recognized" #7
Comments
Please provide a code example for this, I cannot understand what you want to do. |
My code like this: string certificateText = File.ReadAllText("certificate_pub.crt");
string privateKeyText = File.ReadAllText("private.key");
ICertificateProvider provider = new CertificateFromFileProvider(certificateText, privateKeyText);
X509Certificate2 SslCertificate = provider.Certificate;
sslClient.Sstream = new SslStream(sslClient.Nstream, false);
await sslClient.Sstream.AuthenticateAsServerAsync(SslCertificate, iMaumutually, UserProto, false); // A client request to connect the server, an exception is thrown,"The credentials supplied to the package were not recognized" But it works well through the way below: var SslCertificate = new X509Certificate2(pfxName, pfxPasswd); I used the same certificate. |
are you running on .net framework or .net core? Windows or Linux? |
Thank you for your quickly reply. |
@Elylhance Sorry to poke this thread after months, but did you ever manage to make it work? im getting the same error and my other options i to make a custom installer and make sure openssl is installed which i kinda dont wanna do. |
@Fumi24 Can somebody please create a full example project with dummy private/public keys. (Or the commands on how to create it) ? Else I cannot understand what's going wrong. |
@nelsonjchen maybe you also have some ideas on this issue? |
Wow! That looks like my issue in #9 somewhat. Even the throw the towel in and use a PFX workaround! |
With #10 merged in, it would be interesting if the people experiencing this issue tried out the new constructor that'll store the key in a named container. |
@Elylhance |
@StefH I cannot load my certificates yet with the newest NuGet packet. |
@Elylhance |
Maybe there is some wrong with my routine, but I have no time to solve it. So just close this issue. |
OK. If you need more help in future, just create a new issue. |
Dear StefH
I'm developing a tls server now. I used OpenSSL-X509Certificate2-Provider to import .crt&.key, but when run to AuthenticateAsServerAsync(), an exception occurred with error message"The credentials supplied to the package were not recognized". In the other hand, it works well by converted crt&key to pfx format through openssl tool. So what's wrong here? Is the RSA private key supported? If not, i saw it in the source code.
The text was updated successfully, but these errors were encountered: