Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Issue 2642723008: Allow proxying plaintext websockets over http/2 proxy (Closed)

Created:
3 years, 11 months ago by baranovich
Modified:
3 years, 11 months ago
Reviewers:
Bence, Adam Rice, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, Ryan Hamilton
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow proxying plaintext websockets over http/2 proxy Both secure and insecure websockets are proxied using HTTP CONNECT tunnels. But if secure proxy supports HTTP/2 plaintext websockets won't work (ERR_NOT_IMPLEMENTED will be returned). To initiate standard websocket handshake over established tunnel, in HttpStreamFactoryImpl::Job::DoCreateStream we should follow if (!using_spdy_) { ... } code branch, otherwise we end up in SetSpdyHttpStreamOrBidirectionalStreamImpl which returns ERR_NOT_IMPLEMENTED for websocket requests. For wss: scheme, everything works, since ProxyClientSocket (which is HttpProxyClientSocketWrapper) is wrapped with SSLClientSocket establishing TLS connection over the tunnel, HttpStreamFactoryImpl::Job::DoInitConnectionComplete works as expected. But for ws: scheme, |using_ssl_| is false, |proxy_info_.is_https()| is true and we get into the branch where |using_spdy_| is set to true (which is fine for non-websocket requests). This change adds very cumbersome condition allowing plaintext websockets requests over HTTP/2 proxies follow the same code path secure websockets do. BUG=684681 TEST=HttpNetworkTransactionTest.PlaintextWebsocketOverSpdyProxy R=mmenke@chromium.org,ricea@chromium.org Review-Url: https://codereview.chromium.org/2642723008 Cr-Commit-Position: refs/heads/master@{#446020} Committed: https://chromium.googlesource.com/chromium/src/+/a027199ed55462ac711f04cc5c23eff59678beb1

Patch Set 1 #

Total comments: 2

Patch Set 2 : Update comments #

Patch Set 3 : Fix review nits #

Total comments: 4

Patch Set 4 : Fix codestyle #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -1 line) Patch
M net/http/http_network_transaction_unittest.cc View 1 2 3 1 chunk +76 lines, -0 lines 0 comments Download
M net/http/http_stream_factory_impl_job.cc View 1 2 3 1 chunk +9 lines, -1 line 0 comments Download

Messages

Total messages: 22 (9 generated)
baranovich
3 years, 11 months ago (2017-01-20 10:28:28 UTC) #3
Adam Rice
Thanks for this. lgtm with nits. https://codereview.chromium.org/2642723008/diff/1/net/http/http_network_transaction_unittest.cc File net/http/http_network_transaction_unittest.cc (right): https://codereview.chromium.org/2642723008/diff/1/net/http/http_network_transaction_unittest.cc#newcode16575 net/http/http_network_transaction_unittest.cc:16575: SSLSocketDataProvider ssl2(ASYNC, OK); ...
3 years, 11 months ago (2017-01-20 11:15:38 UTC) #4
baranovich
juliatuttle@, PTAL
3 years, 11 months ago (2017-01-23 11:59:21 UTC) #5
baranovich
Matt, would you plz take a look? git cl suggested Julia as a reviewer, but ...
3 years, 11 months ago (2017-01-24 16:19:42 UTC) #7
mmenke
[+bnc]: Mind taking this one? I'm not really familiar with how H2 proxies work.
3 years, 11 months ago (2017-01-24 16:34:46 UTC) #9
Bence
What is the context here, why do we want to allow insecure websockets over HTTP/2 ...
3 years, 11 months ago (2017-01-24 19:28:21 UTC) #10
baranovich
On 2017/01/24 19:28:21, Bence wrote: > What is the context here, why do we want ...
3 years, 11 months ago (2017-01-24 19:59:51 UTC) #12
Bence
Thanks for the detailed explanation and for filing the issue. https://codereview.chromium.org/2642723008/diff/40001/net/http/http_network_transaction_unittest.cc File net/http/http_network_transaction_unittest.cc (right): https://codereview.chromium.org/2642723008/diff/40001/net/http/http_network_transaction_unittest.cc#newcode16536 ...
3 years, 11 months ago (2017-01-24 22:54:19 UTC) #13
baranovich
https://codereview.chromium.org/2642723008/diff/40001/net/http/http_network_transaction_unittest.cc File net/http/http_network_transaction_unittest.cc (right): https://codereview.chromium.org/2642723008/diff/40001/net/http/http_network_transaction_unittest.cc#newcode16536 net/http/http_network_transaction_unittest.cc:16536: NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 80))); On 2017/01/24 22:54:19, ...
3 years, 11 months ago (2017-01-25 09:10:51 UTC) #14
Bence
LGTM. CC-ing rch@ for FYI.
3 years, 11 months ago (2017-01-25 13:11:08 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2642723008/60001
3 years, 11 months ago (2017-01-25 13:14:10 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/a027199ed55462ac711f04cc5c23eff59678beb1
3 years, 11 months ago (2017-01-25 15:03:37 UTC) #21
Adam Rice
3 years, 10 months ago (2017-02-02 19:23:45 UTC) #22
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/2669313002/ by ricea@chromium.org.

The reason for reverting is: I believe this is causing the crashes in
http://crbug.com/685968..

Powered by Google App Engine
This is Rietveld 408576698