Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing h1_client e.g. ClientConfig #61

Closed
markuskobler opened this issue Jan 18, 2021 · 5 comments
Closed

Customizing h1_client e.g. ClientConfig #61

markuskobler opened this issue Jan 18, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@markuskobler
Copy link

markuskobler commented Jan 18, 2021

Following on from #53 being merged what would be the most ergonomic way of supporting a customizable rustls::ClientConfig

I'm looking todo something similar to: async-tls/example

async fn connector_for_ca_file(cafile: &Path) -> io::Result<TlsConnector> {
    let mut config = ClientConfig::new();
    let file = async_std::fs::read(cafile).await?;
    let mut pem = Cursor::new(file);
    config
        .root_store
        .add_pem_file(&mut pem)
        .map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid cert"))?;
    Ok(TlsConnector::from(Arc::new(config)))
}
@Fishrock123 Fishrock123 added the enhancement New feature or request label Jan 19, 2021
@Fishrock123 Fishrock123 changed the title Customizing h1_client_rustls rustls::ClientConfig Customizing h1_client e.g. ClientConfig Jan 27, 2021
@Fishrock123
Copy link
Member

Making this a generic issue for how we should support config without necessitating client overrides.

@otavio
Copy link
Contributor

otavio commented Mar 11, 2021

Is there any news on this? We'd like to set timeouts to the client instance but currently it is not possible.

@Fishrock123 Fishrock123 self-assigned this Mar 12, 2021
Fishrock123 added a commit to Fishrock123/http-client that referenced this issue Mar 13, 2021
work in progress for the long requested and needed configuration

might end up being an unstable feature for a bit, not sure yet

Refs: http-rs#61
@Fishrock123
Copy link
Member

WIP draft PR up for the API: #84

@Fishrock123
Copy link
Member

Now available in 6.4.0 under the unstable-config feature. See #86

Docs need to be updated though, I'm hoping to get 6.4.1 out this week with that fix - #87

@Fishrock123
Copy link
Member

Available by default in 6.5.1: https://github.com/http-rs/http-client/releases/tag/v6.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants