File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use std:: io:: Error ;
22
33use pki_types:: CertificateDer ;
4+ use schannel:: cert_context:: ValidUses ;
5+ use schannel:: cert_store:: CertStore ;
46
57static PKIX_SERVER_AUTH : & str = "1.3.6.1.5.5.7.3.1" ;
68
7- fn usable_for_rustls ( uses : schannel :: cert_context :: ValidUses ) -> bool {
9+ fn usable_for_rustls ( uses : ValidUses ) -> bool {
810 match uses {
9- schannel :: cert_context :: ValidUses :: All => true ,
10- schannel :: cert_context :: ValidUses :: Oids ( strs) => strs
11+ ValidUses :: All => true ,
12+ ValidUses :: Oids ( strs) => strs
1113 . iter ( )
1214 . any ( |x| x == PKIX_SERVER_AUTH ) ,
1315 }
@@ -16,7 +18,7 @@ fn usable_for_rustls(uses: schannel::cert_context::ValidUses) -> bool {
1618pub fn load_native_certs ( ) -> Result < Vec < CertificateDer < ' static > > , Error > {
1719 let mut certs = Vec :: new ( ) ;
1820
19- let current_user_store = schannel :: cert_store :: CertStore :: open_current_user ( "ROOT" ) ?;
21+ let current_user_store = CertStore :: open_current_user ( "ROOT" ) ?;
2022
2123 for cert in current_user_store. certs ( ) {
2224 if usable_for_rustls ( cert. valid_uses ( ) . unwrap ( ) ) && cert. is_time_valid ( ) . unwrap ( ) {
You can’t perform that action at this time.
0 commit comments