Added currently failing test for Verifier. Can't satisfy the function
signature for the rustls provided api.
This commit is contained in:
parent
54fb9e79ab
commit
6e5ba46c26
3 changed files with 19 additions and 0 deletions
|
@ -78,3 +78,22 @@ impl<T: CertificateStore> Verifier<T> {
|
|||
store.into()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::*;
|
||||
|
||||
const CERT: &[u8] = include_bytes!("../../test/certificates/gemini.example.org/cert.der");
|
||||
|
||||
#[test]
|
||||
fn tofu() {
|
||||
let verifier: Verifier<HashMap<String, String>> = HashMap::new().into();
|
||||
let cert = rustls::Certificate(CERT.into());
|
||||
let name = rustls::ServerName::try_from("gemini.example.org").unwrap();
|
||||
let now = time::SystemTime::now();
|
||||
let mut scts: Vec<&[u8]> = vec![];
|
||||
let res = verifier.verify_server_cert(&cert, &[], &name, &mut scts.iter(), &[], now);
|
||||
}
|
||||
}
|
||||
|
|
BIN
test/certificates/gemini.example.org/cert.der
Normal file
BIN
test/certificates/gemini.example.org/cert.der
Normal file
Binary file not shown.
BIN
test/certificates/gemini.example.org/key.der
Normal file
BIN
test/certificates/gemini.example.org/key.der
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue