pub fn load_certs(filename: &str) -> io::Result<Vec<rustls::Certificate>> {
    // Open certificate file.
    let certfile = fs::File::open(filename)
        .map_err(|e| error(format!("failed to open {}: {}", filename, e)))?;
    let mut reader = io::BufReader::new(certfile);

    // Load and return certificate.
    pemfile::certs(&mut reader).map_err(|_| error("failed to load certificate".into()))
}
// Load public certificate from file.
Load public certificate from file.
Load public certificate from file .
pub fn load_certs(filename: &str) -> io::Result<Vec<rustls::Certificate>> {
    // Open certificate file.
    let certfile = fs::File::open(filename)
        .map_err(|e| error(format!("failed to open {}: {}", filename, e)))?;
    let mut reader = io::BufReader::new(certfile);
    // Load and return certificate.
    pemfile::certs(&mut reader).map_err(|_| error("failed to load certificate".into()))
}
pub fn load_certs ( filename : & str ) -> io :: Result < Vec < rustls :: Certificate > > { // Open certificate file. let certfile = fs :: File :: open ( filename ) . map_err ( | e | error ( format ! ( " " filename e ) ) ) ? ; let mut reader = io :: BufReader :: new ( certfile ) ; // Load and return certificate. pemfile :: certs ( & mut reader ) . map_err ( | _ | error ( " " . into ( ) ) ) }
Load public certificate from file.
Load public certificate from file .
filename
&str
filename
&str