You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to see this happen:
We should be able to connect to the server via the key, or return some error like DNSNameError which hints the key is invalid.
Some notes:
By reading the code, I have noticed that we are going to extract key via applying pkcs8_private_keys and rsa_private_keys. It seems rustls-pemfile supports SEC1 EC keys however doesn't provide something like ec_private_keys (!).
Perhaps we can use read_once direcly, so we only need to iterate the key file once and can extract the EC keys:
fnload_rustls_private_key(mutcursor: std::io::Cursor<&[u8]>,) -> Result<PrivateKey,crate::Error>{whileletOk(Some(item)) = rustls_pemfile::read_one(&mut cursor){match item {
rustls_pemfile::Item::RSAKey(key)
| rustls_pemfile::Item::PKCS8Key(key)
| rustls_pemfile::Item::ECKey(key) => returnOk(PrivateKey(key)),
_ => continue,}}// Otherwise we have a Private Key parsing problemErr(Box::new(TlsError::PrivateKeyParseError))}
-->
The text was updated successfully, but these errors were encountered:
Bug Report
Version
Platform
Linux 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Crates
tonic
, with featuretls
enabled.Description
I tried this code:
Generally, I have wrote a client looks like this:
Which fills the tls config like:
With a client key file generated by:
openssl ecparam -out "$TEST_DIR/certs/$cluster.key" -name prime256v1 -genkey
I expected to see this happen:
We should be able to connect to the server via the key, or return some error like
DNSNameError
which hints the key is invalid.Instead, this happened:
It returns a error like:
Some notes:
By reading the code, I have noticed that we are going to extract key via applying
pkcs8_private_keys
andrsa_private_keys
. It seemsrustls-pemfile
supportsSEC1 EC
keys however doesn't provide something likeec_private_keys
(!).Perhaps we can use
read_once
direcly, so we only need to iterate the key file once and can extract the EC keys:-->
The text was updated successfully, but these errors were encountered: