fn create_http_client(ca_file: Option<&str>) -> Result<Client, AnyError> {
  let mut builder = Client::builder().redirect(Policy::none()).use_rustls_tls();
  if let Some(ca_file) = ca_file {
    let mut buf = Vec::new();
    File::open(ca_file)?.read_to_end(&mut buf)?;
    let cert = reqwest::Certificate::from_pem(&buf)?;
    builder = builder.add_root_certificate(cert);
  }
  builder
    .build()
    .map_err(|_| deno_core::error::generic_error("Unable to build http client"))
}
/// Create new instance of async reqwest::Client. This client supports
/// proxies and doesn't follow redirects.
Create new instance of async reqwest::Client. This client supports
proxies and doesn't follow redirects.
Create new instance of async reqwest :: Client . This client supports proxies and doesn ' t follow redirects .
fn create_http_client(ca_file: Option<&str>) -> Result<Client, AnyError> {
  let mut builder = Client::builder().redirect(Policy::none()).use_rustls_tls();
  if let Some(ca_file) = ca_file {
    let mut buf = Vec::new();
    File::open(ca_file)?.read_to_end(&mut buf)?;
    let cert = reqwest::Certificate::from_pem(&buf)?;
    builder = builder.add_root_certificate(cert);
  }
  builder
    .build()
    .map_err(|_| deno_core::error::generic_error("Unable to build http client"))
}
fn create_http_client ( ca_file : Option < & str > ) -> Result < Client , AnyError > { let mut builder = Client :: builder ( ) . redirect ( Policy :: none ( ) ) . use_rustls_tls ( ) ; if let Some ( ca_file ) = ca_file { let mut buf = Vec :: new ( ) ; File :: open ( ca_file ) ? . read_to_end ( & mut buf ) ? ; let cert = reqwest :: Certificate :: from_pem ( & buf ) ? ; builder = builder . add_root_certificate ( cert ) ; } builder . build ( ) . map_err ( | _ | deno_core :: error :: generic_error ( " " ) ) }
Create new instance of async reqwest::Client.
Create new instance of async reqwest :: Client .
ca_file
Option<&str>
ca_file
Option<&str>