Skip to content

Commit

Permalink
fix #22: windows local machine certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
TimLuq committed Feb 9, 2023
1 parent 651e8bb commit ec2992c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@ pub fn load_native_certs() -> Result<Vec<Certificate>, Error> {
}
}

if let Ok(current_machine_store) = schannel::cert_store::CertStore::open_local_machine("ROOT") {
for cert in current_machine_store.certs() {
if usable_for_rustls(cert.valid_uses().unwrap()) && cert.is_time_valid().unwrap() {
certs.push(Certificate(cert.to_der().to_vec()));
}
}
}

Ok(certs)
}

0 comments on commit ec2992c

Please sign in to comment.