nu-command 0.112.1

Nushell's built-in commands
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use nu_protocol::ShellError;
use ureq::tls::{TlsConfig, TlsProvider};

#[doc = include_str!("./tls_config.rustdoc.md")]
pub fn tls_config(allow_insecure: bool) -> Result<TlsConfig, ShellError> {
    // The impl for rustls has the option to use other root certificates.
    // This is kind ob unnecessary for the native tls, as we expect to run with an OS.
    Ok(TlsConfig::builder()
        .provider(TlsProvider::NativeTls)
        .disable_verification(allow_insecure)
        .build())
}