RFC 7639 ALPN - #731
Conversation
42fd028 to
6140646
Compare
4b95aca to
8f872b6
Compare
aea3fa3 to
5fa9a19
Compare
5fa9a19 to
16b5442
Compare
|
@arturobernalg Could you please rebase this change-set? |
cc58cd1 to
208b565
Compare
@ok2c done. |
208b565 to
eed86b1
Compare
733a98c to
a910585
Compare
a178fe7 to
e343841
Compare
249924c to
bfb72b3
Compare
bfb72b3 to
f5f17fd
Compare
|
@arturobernalg This change can still make it into |
36079e1 to
46a533e
Compare
@ok2c please do another pass |
05a370f to
0af7b0f
Compare
ok2c
left a comment
There was a problem hiding this comment.
@arturobernalg Much, much better! However, we need to figure out a better of way of passing the actual TLS policy to the interceptors. I would try to solve it by adding HttpVersionPolicy as an attribute to HttpClientContext
81027eb to
d16d456
Compare
| final SocketConfig socketConfig = resolveSocketConfig(route); | ||
| final ConnectionConfig connectionConfig = resolveConnectionConfig(route); | ||
| final TlsConfig tlsConfig = resolveTlsConfig(route.getTargetHost()); | ||
| HttpClientContext.castOrCreate(context).setHttpVersionPolicy(tlsConfig.getHttpVersionPolicy()); |
There was a problem hiding this comment.
@arturobernalg One last bit. Let's do HttpClientContext#cast here instead and assign the attribute only if the context is non null. There is no point creating a new context here.
| LOG.debug("{} connecting endpoint to {} ({})", ConnPoolSupport.getId(endpoint), firstHop, connectTimeout); | ||
| } | ||
| final TlsConfig targetTlsConfig = resolveTlsConfig(route.getTargetHost()); | ||
| HttpClientContext.castOrCreate(context).setHttpVersionPolicy(targetTlsConfig.getHttpVersionPolicy()); |
ok2c
left a comment
There was a problem hiding this comment.
@arturobernalg Almost there. See my comments
Encode protocol IDs with core's PercentCodec.HTTP_TOKEN (canonical RFC 7230 tchar form, uppercase hex) and decode strictly, rejecting malformed percent-encoding with ProtocolException. The advertised protocol set is derived from the target's HttpVersionPolicy. The connection manager resolves the effective TlsConfig and publishes the policy on HttpClientContext before the connection is established; ConnectExec and AsyncConnectExec read it back and, on secure CONNECT tunnels, advertise the same protocols the tunnel's TLS layer will offer, so the header cannot diverge from the protocol negotiated inside the tunnel. Interceptors fall back to NEGOTIATE when no policy is present on the context.
Please do a
@ok2c Please do another pass. |
ok2c
left a comment
There was a problem hiding this comment.
@arturobernalg Please add RFC 7639 to the list of supported RFCs in README.md and feel free to merge.
Add ConnectAlpnProvider and inject ALPN header in ConnectExec/AsyncConnectExec. Provide builder hooks for fixed list or provider-driven values.