workers-rs: Unable to get local issuer certificate

I'm attempting to use the reqwest library within my worker to contact a third-party api.
async fn test_reqwest() -> Result<String> {
let resp = reqwest::get("https://workers.cloudflare.com").await.unwrap().await.unwrap();
Ok(String::from(resp))
}
async fn test_reqwest() -> Result<String> {
let resp = reqwest::get("https://workers.cloudflare.com").await.unwrap().await.unwrap();
Ok(String::from(resp))
}
I am running the worker using wrangler dev When the request is made wrangler shows the following error: workerd/jsg/util.c++:275: error: e = kj/compat/tls.c++:221: failed: TLS peer's certificate is not trusted; reason = unable to get local issuer certificate The same happens if I use workers Fetch api:
async fn test_reqwest() -> Result<String> {
let mut resp = Fetch::Url("https://httpbin.org/anything".parse().unwrap())
.send()
.await?;
let txt = resp.text().await?;
Ok(String::from(txt))
}
async fn test_reqwest() -> Result<String> {
let mut resp = Fetch::Url("https://httpbin.org/anything".parse().unwrap())
.send()
.await?;
let txt = resp.text().await?;
Ok(String::from(txt))
}
Is there a feature / configuration change I need to make to allow the worker to access third party apis? Thank you.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server