Toy implementation of the gemini protocol
use std::time::SystemTime;

use rustls::{client::ServerCertVerified, Certificate, Error, ServerName};

// unconditionally trusts
#[derive(Default)]
pub struct Naive;
// trust on first use
pub struct Tofu {}
impl rustls::client::ServerCertVerifier for Naive {
    fn verify_server_cert(
        &self,
        _: &Certificate,
        _: &[Certificate],
        _: &ServerName,
        _: &mut dyn Iterator<Item = &[u8]>,
        _: &[u8],
        _: SystemTime,
    ) -> Result<ServerCertVerified, Error> {
        Ok(ServerCertVerified::assertion())
    }
}