File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -159,14 +159,14 @@ pub struct Identity {
159159impl 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
You can’t perform that action at this time.
0 commit comments