Repository navigation
Make encrypt_after_connect support work - #40709
Conversation
|
|
||
| _host, self.port = self.httpd.socket.getsockname() | ||
| except Exception: | ||
| except Exception as e: |
There was a problem hiding this comment.
unit test failed due to this line:
./wptserve/wptserve/server.py:846:9: F841 local variable 'e' is assigned to but never used
There was a problem hiding this comment.
Thanks, fixed now
| use_ssl=False, | ||
| key_file=None, | ||
| certificate=None, | ||
| use_ssl=True, |
There was a problem hiding this comment.
Seems when use_ssl is true, the scheme will be https. Is this what we want? (A bit of background might help.)
There was a problem hiding this comment.
Yeah, hm, I think you're right that it shouldn't. Fixed.
| # We can hardcore http here instead of using scheme because this only | ||
| # happens when the server is used as a proxy server, and that never | ||
| # sends an HTTPS URL (because those use CONNECT) | ||
| if self.request_path.startswith("http://"): |
There was a problem hiding this comment.
So now line 294 is only for connecting to a proxy server's case. This does not seem to be the case previously.
There was a problem hiding this comment.
Why do you say that? In which non-proxy cases would a user agent send a URL with scheme in the request?
That said, given the other change this is no longer needed so I reverted it.
9ad004b to
667f18a
Compare
cbiesinger
left a comment
There was a problem hiding this comment.
Thanks for the comments! Please take another look, @WeizhongX
| # We can hardcore http here instead of using scheme because this only | ||
| # happens when the server is used as a proxy server, and that never | ||
| # sends an HTTPS URL (because those use CONNECT) | ||
| if self.request_path.startswith("http://"): |
There was a problem hiding this comment.
Why do you say that? In which non-proxy cases would a user agent send a URL with scheme in the request?
That said, given the other change this is no longer needed so I reverted it.
| use_ssl=False, | ||
| key_file=None, | ||
| certificate=None, | ||
| use_ssl=True, |
There was a problem hiding this comment.
Yeah, hm, I think you're right that it shouldn't. Fixed.
|
The test failed with below message. Is this expected? /infrastructure/server/test-pac.html |
|
FYI this is not ready for merge, it breaks |
e54cee8 to
2e589e4
Compare
2e589e4 to
dc522a3
Compare
|
OK, I think this is now ready to land. Sorry for the very long delay. This will be useful for FedCM and EVP tests. |
|
The MacOS failure looks unrelated (unexpected passes in unrelated files) |
jonathan-j-lee
left a comment
There was a problem hiding this comment.
Given how old this PR is, I re-reviewed it and it still LGTM.
Enable encrypt_after_connect on the plain HTTP server when SSL is available, so that a PAC file can route https:// requests through it. Always compute an SSL config when certificates are available, even if the SSL environment is not otherwise enabled. Also pass the CA certificate path for the pregenerated certificates so that an SSL config is produced by default, and fall back to plain HTTP in start_http_server when there is no SSL config. Extend infrastructure/server/test-pac to cover an https:// request through the proxy. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Close TLS connections set up after a CONNECT request in finish(), sending a close_notify first. socketserver only closes the socket it accepted, which wrap_socket() detaches, so the TLS socket was left open. This replaces shutting down every connection that is marked to be closed, which ended TLS connections without a close_notify. Track the scheme per connection, so that requests sent through a CONNECT tunnel have an https URL instead of the HTTP server's scheme. Explain why the connection is kept open after a CONNECT request. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
dc522a3 to
7d3ec72
Compare
3b8aed1
into
web-platform-tests:master
And also enable it for wptrunner.
There were a few bugs here:
This PR also sets encrypt_after_connect to True when SSL is not turned on.