I'm trying to use Reqwest's proxy feature to pass user:pass basic auth with the rest of the URL into the proxy function. Apparently, the way this crate works basic auth can't be passed this way for the proxy.
When I commented out proxy I got my data but it didn't go through my proxy:
let raw_proxy = format!("https://{}:{}@{}", username, password, forward_proxy);
let proxy = reqwest::Proxy::all(&raw_proxy).unwrap();
let mut buf = &mut Vec::new();
File::open("../cert.der").unwrap().read_to_end(&mut buf).unwrap();
let cert = reqwest::Certificate::from_der(&buf).unwrap();
let client = reqwest::Client::builder()
.add_root_certificate(cert)
//.proxy(proxy)
.build().unwrap();
let mut res = client.post("http://httpbin.org/post")
.header(ContentType::json())
.body(format!("{}", redacted_data))
.send().unwrap();