-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: support HTTPs PROXY URL #11708
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1833,7 +1833,7 @@ int flb_utils_url_split_sds(const flb_sds_t in_url, flb_sds_t *out_protocol, | |
| /* | ||
| * flb_utils_proxy_url_split parses a proxy's information from a http_proxy URL. | ||
| * The URL is in the form like `http://[username:password@]myproxy.com:8080`. | ||
| * Note: currently only HTTP is supported. | ||
| * Note: currently only HTTP(s) is supported. | ||
| */ | ||
| int flb_utils_proxy_url_split(const char *in_url, char **out_protocol, | ||
| char **out_username, char **out_password, | ||
|
|
@@ -1869,9 +1869,9 @@ int flb_utils_proxy_url_split(const char *in_url, char **out_protocol, | |
| return -1; | ||
| } | ||
|
|
||
| /* Only HTTP proxy is supported for now. */ | ||
| if (strcmp(protocol, "http") != 0) { | ||
| flb_error("only HTTP proxy is supported."); | ||
| /* Only HTTP(s) proxy is supported for now. */ | ||
| if (strcmp(protocol, "http") != 0 && strcmp(protocol, "https") != 0) { | ||
| flb_error("only HTTP(s) proxy is supported."); | ||
|
Comment on lines
+1872
to
+1874
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HTTPS support is incomplete when proxy port is omitted. After allowing 🔧 Proposed fix@@
- else if (*(end + 1) == '\0') {
- port = flb_strdup("80");
+ else if (*(end + 1) == '\0') {
+ if (strcmp(protocol, "https") == 0) {
+ port = flb_strdup("443");
+ }
+ else {
+ port = flb_strdup("80");
+ }
if (!port) {
flb_errno();
goto error;
}
}
@@
- port = flb_strdup("80");
+ if (strcmp(protocol, "https") == 0) {
+ port = flb_strdup("443");
+ }
+ else {
+ port = flb_strdup("80");
+ }
if (!port) {
flb_errno();
goto error;
}
}Also applies to: 1951-1953, 1991-1993 🤖 Prompt for AI Agents |
||
| goto error; | ||
| } | ||
|
|
||
|
|
||
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.
httpsproxy scheme until transport handles itflb_utils_proxy_url_splitnow acceptshttpsURLs, but the parsed protocol is not used downstream:flb_upstream_createfreesproxy_protocoland still builds a normal TCP upstream (src/flb_upstream.c, proxy setup block), thenflb_io_net_connectsendsCONNECTover that plain socket before any TLS handshake (src/flb_io.candflb_http_client_proxy_connect). For real HTTPS proxies (TLS to proxy), this path fails because the proxy expects TLS first, so this commit advertises support that does not actually work for the new accepted input.Useful? React with 👍 / 👎.