Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support request specific TLS configuration #358
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
Support request specific TLS configuration #358
Changes from 6 commits
01ff24e
2b11cd6
2beb65f
4111aaa
0a2e939
72b1930
e2e6817
b9e4a34
cb28d0e
22c5f25
b89c92b
ed45320
dabaebb
21a76d1
461be39
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artemredkin should we add a test case that targets the pool directly here? Ie no actual connections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding the naming here somewhat confusing: keyConfiguration is not derived from the key but from
configuration
, and then we override it with the TLS configuration fromkey
.I think it'd be nice to wrap this logic up into something written as a function that clarifies what it does (merges config from two sources, preferring config in the
key
to the general configuration.I'm also a bit uncertain as to why this is necessary. Why isn't
configuration
already carrying this TLS config?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should this merge perhaps be done at a higher level, say when we create the
HTTP1ConnectionProvider
? I am a bit nervous about having two separate configs from the perspective of the connection provider: it should always be creating the exact same connection each time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuration
is specific for the entireHTTPClient
, so atm it passes down the configuration of client through all these methods. So, we need at some point to override thetlsConfiguration
of it.I moved the actual configuration "generation" to the place where we initialize the connection provider as you suggested, and added
config(overriding:)
toKey
to retrieve key-specific configuration. Let me know, if this is better!