Open
Conversation
…unnel usage)
GCS server does not handle requests with port, and simply report an
error:
<?xml version="1.0"?>
<?xml version='1.0' encoding='UTF-8'?>
<Error>
<Code>InvalidURI</Code>
<Message>Couldn't parse the specified URI.</Message>
<Details>Invalid URL: storage.googleapis.com:443/...</Details>
</Error>
Removing the port fixes the issue. Note that there is port in the Host
header anyway.
Note, this is a problem only for proxy in a tunnel mode, since only it
sends such requests, other sends requests directly via HTTP methods.
Replace space indentation with tabs to match project conventions. Fix copy-paste error in setProxyProtocol() error message. Update copyright year in ProxyConfig.h.
- Fix missing _proxySessionFactory registration in (host, port, ProxyConfig) constructor causing UnknownURISchemeException at connection time - Fix HTTPSClientSession::proxyRequestPrefix() regression: return empty string in tunnel mode to avoid corrupting request URIs - Fix empty proxyAuthenticate() override silently dropping credentials in non-tunnel HTTPS proxy mode - Add protocol validation and connected-state check to setProxyConfig() and setGlobalProxyConfig() - Wrap destructor unregisterProtocol() in try/catch to prevent std::terminate - Include HTTP status code in proxyConnect() error message - Use InvalidArgumentException instead of IllegalStateException for protocol validation - Extract factory registration into initProxySessionFactory() helpers to prevent future missed-constructor bugs - Modernize ProxyAuthentication to enum class with None/Basic/Digest/NTLM - Use default member initializers in ProxyConfig (enables C++20 designated initializers) - Add [[nodiscard]] to key getters, modernize copy deletion to = delete - Add 10 new unit tests covering ProxyConfig defaults, protocol validation, setters, request prefix, non-tunnel mode, global config, and bypass behavior - Update HTTPTestServer to handle proxy requests without default port - Fix copyright year and doc-comment style
b6c77b7 to
4d6920f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #3035. Replaces #3691.
Rebased and cleaned-up implementation of HTTPS proxy support, originally based on work from #3040 (#3035).
trueby default for backward-compatibilitytrueby default. This was done also for backward-compatibilityProxyConfigto a separate class for cleaner APIshared_ptrusage in proxy configurationChanges
Net/include/Poco/Net/ProxyConfig.h— newProxyConfigclass extracted fromHTTPClientSessionNet/include/Poco/Net/HTTPClientSession.h— refactored to useProxyConfigNet/include/Poco/Net/HTTPSessionFactory.h— updated proxy config APINet/include/Poco/Net/HTTPSessionInstantiator.h— updated proxy config APINet/src/HTTPClientSession.cpp— HTTPS proxy connection logicNet/src/HTTPSessionFactory.cpp— updated to useProxyConfigNet/src/HTTPSessionInstantiator.cpp— updated to useProxyConfigNetSSL_OpenSSL/src/HTTPSClientSession.cpp— HTTPS proxy tunnel supportNet/testsuite/src/HTTPClientSessionTest.cpp— test updates