Skip to content

Commit 0f91cd7

Browse files
committed
Revert the order of the chain in Identity from PKCS12
1 parent a512918 commit 0f91cd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/imp/openssl.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ impl Identity {
163163
Ok(Identity {
164164
pkey: parsed.pkey,
165165
cert: parsed.cert,
166-
chain: parsed.chain.into_iter().flatten().collect(),
166+
// > The stack is the reverse of what you might expect due to the way
167+
// > PKCS12_parse is implemented, so we need to load it backwards.
168+
// > https://github.com/sfackler/rust-native-tls/commit/05fb5e583be589ab63d9f83d986d095639f8ec44
169+
chain: parsed.chain.into_iter().flatten().rev().collect(),
167170
})
168171
}
169172

0 commit comments

Comments
 (0)