Allow adding certificate to default ReqwestClient
Description
Hi! First time poster here, so I wanted to say thanks for all the hard work! We're a Paris-based startup that has recently begun testing integration with meilisearch in our stack with the rust SDK.
We were wondering if it could be possible to expose some additional functionality of the default Client. In particular, we'd like to supply a root certificate to the client, to allow us to conduct integration tests by interacting with a meilisearch instance over https.
Our current workaround has been to copy-paste the entire implementation of the ReqwestClient, with a couple of additional lines dedicated to setting the root certificate in the reqwest::ClientBuilder.
Basic example The simplest implementation I can imagine would be something like:
impl ReqwestClient {
pub fn new_with_certificate(api_key: Option<&str>, cert: reqwest::tls::Certificate) -> Result<Self, Error> {
// ...
let client = builder.add_root_certificate(cert)
.build()?;
Ok(ReqwestClient { client })
}
}
But I'm not sure how this aligns with your vision for the SDK ecosystem; perhaps a new_with_config(..) of some kind would work better. A different approach might be to allow the caller to supply their own ClientBuilder.
Regardless, if this is something that could work for you, I'd be happy to open a PR.
Thanks again!