Skip to content

Commit

Permalink
refactor: add error log for self signed certificate fail
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Dec 15, 2024
1 parent f1b2f6f commit eb97a4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/config/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ ai02RHnemmqJaNepfmCdyec=
let result = conf.validate();
assert_eq!(true, result.is_ok());

assert_eq!("488642d0e54f33b6", conf.hash_key());
assert_eq!("df7255ff75e0f40c", conf.hash_key());
}

#[test]
Expand Down
26 changes: 16 additions & 10 deletions src/proxy/dynamic_certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,16 +482,22 @@ impl pingora::listeners::TlsAccept for DynamicCertificate {

// root ca
if d.is_root {
if let Ok(result) =
d.get_self_signed_cert(server_name.unwrap_or_default())
{
ssl_certificate(
ssl,
&result.0,
&result.1,
&d.chain_certificate,
);
}
match d.get_self_signed_cert(server_name.unwrap_or_default()) {
Ok(result) => {
ssl_certificate(
ssl,
&result.0,
&result.1,
&d.chain_certificate,
);
},
Err(err) => {
error!(
error = err.to_string(),
"get self signed cert fail"
);
},
};
return;
}

Expand Down

0 comments on commit eb97a4d

Please sign in to comment.