Skip to content

Commit 3ecd9e5

Browse files
djcctz
authored andcommitted
Upgrade openssl-probe to 0.2
1 parent 9bfdb68 commit 3ecd9e5

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
1212
[dependencies]
1313
env_logger = "0.11"
1414
log = "0.4"
15-
openssl-probe = "0.1"
15+
openssl-probe = "0.2"
1616
openssl-sys = "0.9"
1717
rustls = "0.23.31"
1818

src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl SslConfigCtx {
220220
match &self.state {
221221
State::Validating => Ok(ActionResult::Applied),
222222
State::ApplyingToCtx(ctx) => {
223-
ctx.get_mut().default_cert_dir = Some(path.into());
223+
ctx.get_mut().default_cert_dir = vec![path.into()];
224224
Ok(ActionResult::Applied)
225225
}
226226
State::ApplyingToSsl(_) => {

src/lib.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ pub struct SslContext {
452452
verify_x509_store: OwnedX509Store,
453453
alpn: Vec<Vec<u8>>,
454454
default_cert_file: Option<PathBuf>,
455-
default_cert_dir: Option<PathBuf>,
455+
default_cert_dir: Vec<PathBuf>,
456456
alpn_callback: callbacks::AlpnCallbackConfig,
457457
cert_callback: callbacks::CertCallbackConfig,
458458
servername_callback: callbacks::ServerNameCallbackConfig,
@@ -484,7 +484,7 @@ impl SslContext {
484484
verify_x509_store: OwnedX509Store::default(),
485485
alpn: vec![],
486486
default_cert_file: None,
487-
default_cert_dir: None,
487+
default_cert_dir: vec![],
488488
alpn_callback: callbacks::AlpnCallbackConfig::default(),
489489
cert_callback: callbacks::CertCallbackConfig::default(),
490490
servername_callback: callbacks::ServerNameCallbackConfig::default(),
@@ -1544,13 +1544,16 @@ impl Ssl {
15441544

15451545
if let Some(default_cert_file) = &ctx.default_cert_file {
15461546
verify_roots.add_from_files([default_cert_file.to_path_buf()])?;
1547-
} else if let Some(default_cert_dir) = &ctx.default_cert_dir {
1548-
let entries = match fs::read_dir(default_cert_dir) {
1547+
}
1548+
1549+
for cert_dir in &ctx.default_cert_dir {
1550+
let entries = match fs::read_dir(cert_dir) {
15491551
Ok(iter) => iter,
15501552
Err(err) => return Err(error::Error::from_io(err).raise()),
15511553
}
15521554
.filter_map(|entry| entry.ok())
1553-
.map(|dir_entry| dir_entry.path());
1555+
.map(|dir_entry| dir_entry.path())
1556+
.filter(|path| path.is_file());
15541557

15551558
verify_roots.add_from_files(entries)?;
15561559
}

0 commit comments

Comments
 (0)