Skip to content

allow per request TLS settings #330

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

Closed
weissi opened this issue Jan 19, 2021 · 3 comments
Closed

allow per request TLS settings #330

weissi opened this issue Jan 19, 2021 · 3 comments

Comments

@weissi
Copy link
Contributor

weissi commented Jan 19, 2021

Currently, we configure TLS globally per HTTPClient. Usually, that's fine but there are use cases where we need different TLS settings per server etc.

As @Lukasa point out, this unfortunately has consequences for the connection pool: Currently we key the pool with (protocol, host, port) which would then no longer work and we'd have to change the key to (protocol, host, port, TLS config) which doesn't sound too bad of a change and enables quite a few new use cases.

@weissi
Copy link
Contributor Author

weissi commented Jan 19, 2021

API could be

HTTPClient.Request(url: "https://my-server1.corp/foo/bar",
                   method: .POST,
                   tlsConfiguration: specialServer1Settings)

@weissi
Copy link
Contributor Author

weissi commented Jan 19, 2021

Currently, the key is

    struct Key: Hashable {
        var scheme: Scheme
        var host: String
        var port: Int
        var unixPath: String

I think the only thing we'd need to do is add a var tlsConfiguration: TLSConfiguration? there (and make TLSConfigurable Hashable)

@weissi
Copy link
Contributor Author

weissi commented May 11, 2021

fixed with #358

@weissi weissi closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant