nex-socket 0.9.0

Cross-platform socket library. Part of nex project. Offers socket-related functionality.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io;

/// Get the native certificates from the system. return rustls::RootCertStore
pub fn get_native_certs() -> io::Result<rustls::RootCertStore> {
    let mut root_store = rustls::RootCertStore::empty();
    match rustls_native_certs::load_native_certs() {
        Ok(certs) => {
            for cert in certs {
                match root_store.add(cert) {
                    Ok(_) => {}
                    Err(_) => {}
                }
            }
            Ok(root_store)
        }
        Err(e) => return Err(e),
    }
}