We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Welcome to the fl-url wiki!
[dependencies] flurl = { git="https://github.com/MyJetTools/fl-url.git", tag = "0.2.3", features=["with-client-cert"] }
use std::{fs::File, io::Read}; use native_tls::Identity; use crate::FlUrl; let mut cert_file = File::open("/Users/user/Downloads/client-cert.pfx").unwrap(); let mut cert_content = Vec::new(); let load_size = cert_file.read_to_end(&mut cert_content).unwrap(); println!("Cert size is {} bytes", cert_content.len()); let certificate = Identity::from_pkcs12(cert_content.as_slice(), "password").unwrap(); let mut fl_url = FlUrl::new("https://website-under-client-certificate.com/") .with_client_certificate(certificate) .get() .await .unwrap(); println!("Result: {}", fl_url.get_status_code()); let result = fl_url.get_body().await.unwrap(); println!("Result: {}", std::str::from_utf8(&result).unwrap());