// Creates a client configured to ignore errors when checking the
// self-signed certificate.
Creates a client configured to ignore errors when checking the
self-signed certificate.
Creates a client configured to ignore errors when checking the self - signed certificate .
fn ssl_client(lang: Option<&str>, if_none_match: Option<&str>) -> Client {
        use std::sync::Arc;
        let mut config = ClientConfig::new();
        let protos = vec![b"http/1.1".to_vec()];
        config.set_protocols(&protos);
        config
            .dangerous()
            .set_certificate_verifier(Arc::new(NoCertificateVerification {}));
        let connector = Connector::new().rustls(Arc::new(config)).finish();
        let mut builder = ClientBuilder::new();
        if let Some(lang) = lang {
            builder = builder.header(actix_web::http::header::ACCEPT_LANGUAGE, lang);
        }
        if let Some(if_none_match) = if_none_match {
            builder = builder.header(actix_web::http::header::IF_NONE_MATCH, if_none_match);
        }
        builder.connector(connector).finish()
    }
fn ssl_client ( lang : Option < & str > , if_none_match : Option < & str > ) -> Client { use std :: sync :: Arc ; let mut config = ClientConfig :: new ( ) ; let protos = vec ! [ b" " to_vec ( ) ] ; config . set_protocols ( & protos ) ; config . dangerous ( ) . set_certificate_verifier ( Arc :: new ( NoCertificateVerification { } ) ) ; let connector = Connector :: new ( ) . rustls ( Arc :: new ( config ) ) . finish ( ) ; let mut builder = ClientBuilder :: new ( ) ; if let Some ( lang ) = lang { builder = builder . header ( actix_web :: http :: header :: ACCEPT_LANGUAGE , lang ) ; } if let Some ( if_none_match ) = if_none_match { builder = builder . header ( actix_web :: http :: header :: IF_NONE_MATCH , if_none_match ) ; } builder . connector ( connector ) . finish ( ) }
Creates a client configured to ignore errors when checking the
self-signed certificate.
Creates a client configured to ignore errors when checking the self - signed certificate .
lang
Option<&str>
if_none_match
Option<&str>