Skip to content

Commit 4b17833

Browse files
committed
fix deprecation warnings
1 parent dbc156a commit 4b17833

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/imp/openssl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ pub struct Identity {
159159
impl Identity {
160160
pub fn from_pkcs12(buf: &[u8], pass: &str) -> Result<Identity, Error> {
161161
let pkcs12 = Pkcs12::from_der(buf)?;
162-
let parsed = pkcs12.parse(pass)?;
162+
let parsed = pkcs12.parse2(pass)?;
163163
Ok(Identity {
164-
pkey: parsed.pkey,
165-
cert: parsed.cert,
164+
pkey: parsed.pkey.ok_or_else(|| Error::EmptyChain)?,
165+
cert: parsed.cert.ok_or_else(|| Error::EmptyChain)?,
166166
// > The stack is the reverse of what you might expect due to the way
167167
// > PKCS12_parse is implemented, so we need to load it backwards.
168168
// > https://github.com/sfackler/rust-native-tls/commit/05fb5e583be589ab63d9f83d986d095639f8ec44
169-
chain: parsed.chain.into_iter().flatten().rev().collect(),
169+
chain: parsed.ca.into_iter().flatten().rev().collect(),
170170
})
171171
}
172172

0 commit comments

Comments
 (0)