Skip to content

Commit a0e4ef7

Browse files
authored
Merge pull request #34 from alexcrichton/expose-cert-iterator
Go ahead and publish `&Path` iterator function
2 parents 3cef693 + 28428e5 commit a0e4ef7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ pub struct ProbeResult {
1616
/// found.
1717
///
1818
/// This will only search known system locations.
19+
#[doc(hidden)]
20+
#[deprecated(note = "use `candidate_cert_dirs` instead")]
1921
pub fn find_certs_dirs() -> Vec<PathBuf> {
20-
cert_dirs_iter().map(Path::to_path_buf).collect()
22+
candidate_cert_dirs().map(Path::to_path_buf).collect()
2123
}
2224

23-
// TODO: when we bump to 0.2, make this the `find_certs_dirs` function
24-
fn cert_dirs_iter() -> impl Iterator<Item = &'static Path> {
25+
/// Probe the system for the directory in which CA certificates should likely be
26+
/// found.
27+
///
28+
/// This will only search known system locations.
29+
pub fn candidate_cert_dirs() -> impl Iterator<Item = &'static Path> {
2530
// see http://gagravarr.org/writing/openssl-certs/others.shtml
2631
[
2732
"/var/ssl",
@@ -161,7 +166,7 @@ fn probe_from_env() -> ProbeResult {
161166
/// The probe result is returned as a [`ProbeResult`] structure here.
162167
pub fn probe() -> ProbeResult {
163168
let mut result = probe_from_env();
164-
for certs_dir in cert_dirs_iter() {
169+
for certs_dir in candidate_cert_dirs() {
165170
// cert.pem looks to be an openssl 1.0.1 thing, while
166171
// certs/ca-certificates.crt appears to be a 0.9.8 thing
167172
let cert_filenames = [

0 commit comments

Comments
 (0)