-
Notifications
You must be signed in to change notification settings - Fork 145
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
rustls failed to parse private key as RSA, EDSA or EdDSA #379
Comments
For additional context, here is the code snippet
Let me know if I am missing something here, but reading through the code for rustls, I don't think so. |
Hi. Fyi the error comes from here. It would be helpful to know which key do you actually use (RSA, ECDSA, or EdDSA) and in which format (Pkcs1, Pkcs8, sec1). Is in in pem or in der? |
We found that in the code. We use RSA and pem format. We did convert our pem to der and got the same problem. Interesting aside my coworker is using rustls in GRPC with certs gen'd from same source and he gets no problems using rustls (tonic uses rustls) for GRPC. |
another note, we switched out rustls back to default and it works. I'd like to see this work with rustls as it seems to be pretty most used. We wanted rustls cause it supports more modern TLS ciphers and protocols. |
Just to clarify, which version of rustls?
Still unclear what is inside of your pem-formatted file. Can you please generate a random keypair and send it to me in the same format for investigation? |
So we figured it out, based on your above questions. This triggered my co-worker to question what format we actually had. Turns out we were pkcs8, thus we converted to pkcs1 (aka traditional) and it now works. Question is why does rustls not support the pkcs8 in this library? Because in the grpc mtls the pkcs8 (using rustls) does work. And btw thank you for your quick responses, much appreciated. |
We dug into the code and when it comes to the mysql library calling rustls, it seems the call is statically defined for pkcs1. So as that was the way it was implemented, maybe this could be a feature request for pkcs8 support as well. |
Just an update, openssl now gens by default pkcs8 and it was mentioned on a google forum that the -traditional switch (which takes a pkcs8 and converts to pkcs1 is gone in current versions or going away. |
I am using mysql and changed the default to use rustls
mysql = { version = "25.0.0", default-features = false, features = ["default-rustls"] }
Can anyone tell me why I would get this error doing mtls
Err(TlsError { unexpected error: failed to parse private key as RSA, ECDSA, or EdDSA })
I use these same certificates with the mysql client and in Golang and it works flawlessly.
The text was updated successfully, but these errors were encountered: