Add error message if cert contains invalid UTF8 data
This commit is contained in:
@@ -65,7 +65,13 @@ fn parse_certificate(cert_file: String, date_format: String) -> CertParseResult
|
|||||||
for tmp in x509.subject_name().entries() {
|
for tmp in x509.subject_name().entries() {
|
||||||
let cname = match tmp.data().as_utf8() {
|
let cname = match tmp.data().as_utf8() {
|
||||||
Ok(a) => a,
|
Ok(a) => a,
|
||||||
Err(_) => continue,
|
Err(e) => {
|
||||||
|
eprintln!(
|
||||||
|
"Skipping invalid UTF8 data in cert file {}: {}",
|
||||||
|
cert_file, e
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
cnames.push(cname.to_string());
|
cnames.push(cname.to_string());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user