diff --git a/Cargo.toml b/Cargo.toml index d1bcfffc0..2b9210140 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,10 +39,10 @@ http = "0.2" hyper = { version = "0.14", features = ["client", "server", "tcp", "http2"] } hyper-rustls = { version = "0.24", optional = true, features = ["http2"] } hyper-tls = { version = "0.5.0", optional = true } -itertools = "0.11" +itertools = "0.12" log = "0.4" percent-encoding = "2" -rustls = { version = "0.21.0", optional = true } +rustls = { version = "^0.22.1", optional = true } rustls-pemfile = { version = "1.0.1", optional = true } seahash = "4" serde = {version = "1.0", features = ["derive"]} diff --git a/src/service_account.rs b/src/service_account.rs index ea73ac065..07f3dc865 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -22,11 +22,7 @@ use base64::Engine as _; use http::Uri; use hyper::client::connect::Connection; use hyper::header; -use rustls::{ - self, - sign::{self, SigningKey}, - PrivateKey, -}; +use rustls::{self, crypto::ring::sign, pki_types::PrivateKeyDer, sign::SigningKey}; use serde::{Deserialize, Serialize}; use time::OffsetDateTime; use tokio::io::{AsyncRead, AsyncWrite}; @@ -42,13 +38,13 @@ fn append_base64 + ?Sized>(s: &T, out: &mut String) { } /// Decode a PKCS8 formatted RSA key. -fn decode_rsa_key(pem_pkcs8: &str) -> Result { +fn decode_rsa_key(pem_pkcs8: &str) -> Result { let private_keys = rustls_pemfile::pkcs8_private_keys(&mut pem_pkcs8.as_bytes()); match private_keys { Ok(mut keys) if !keys.is_empty() => { keys.truncate(1); - Ok(rustls::PrivateKey(keys.remove(0))) + Ok(PrivateKeyDer::Pkcs8(keys.remove(0).into())) } Ok(_) => Err(io::Error::new( io::ErrorKind::InvalidInput,