Skip to content

Instantly share code, notes, and snippets.

@cuongld2
Created September 22, 2020 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuongld2/312d14e0096fd8338983be648e125f1b to your computer and use it in GitHub Desktop.
Save cuongld2/312d14e0096fd8338983be648e125f1b to your computer and use it in GitHub Desktop.
HTTP request ssl certificate
extern crate reqwest;
extern crate tokio;
extern crate serde_json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let res = reqwest::Client::builder()
.danger_accept_invalid_certs(true)
.build()
.unwrap()
.get("ssl_certificate_lacking")
.send().await?;
let json_value = res.text().await?;
println!("{:?}",json_value);
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment