I'm trying to write a test for a custom TLS verifier which uses rustls. The signature for the trait function which verifies a server cert takes &mut dyn Iterator<Item = &[u8]>
as one of it's parameters. I'm trying to create it like this so far:
let mut scts: Vec<&[u8]> = vec![];
I'm then passing it to the function as &mut scts.iter()
. This fails.
let res = verifier.verify_server_cert(&cert, &[], &name, &mut scts.iter(), &[], now);
| ^^^^^^^^^^^^^^^^ expected `&[u8]`, found `&&[u8]`
That makes sense, as it's yeilding a reference to the underlying data. I've tried a couple of other ways which have all failed for one or another reason.
Any help appreciated.