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
Hi,
I have a module which gets passed a rustls_pki_types::CertificateDer and rustls_pki_types::PrivateKeyDer which have to be used as client certificate to make HTTP requests. Therefore I have to create a reqwest::tls::Identity to pass it to the ClientBuilder unfortunately the Identity doesn't support to be created by raw DER formatted data. So the only way of getting an Identity at the moment is to convert the certificate and private key to pem and then read it again with Identity::from_pem. I know that this is not a really good idea because it could leak the private key.
Is there another/better way of doing it?
I guess the best would be to have a function like Identity::from_der(certs: &[u8], private_key: &[u8]).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have a module which gets passed a
rustls_pki_types::CertificateDer
andrustls_pki_types::PrivateKeyDer
which have to be used as client certificate to make HTTP requests. Therefore I have to create areqwest::tls::Identity
to pass it to theClientBuilder
unfortunately theIdentity
doesn't support to be created by raw DER formatted data. So the only way of getting anIdentity
at the moment is to convert the certificate and private key to pem and then read it again withIdentity::from_pem
. I know that this is not a really good idea because it could leak the private key.Is there another/better way of doing it?
I guess the best would be to have a function like
Identity::from_der(certs: &[u8], private_key: &[u8])
.Beta Was this translation helpful? Give feedback.
All reactions