Skip to content
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

Assume http proxy if type is not specified #847

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20)


set(ZITI_SDK_DIR "" CACHE FILEPATH "developer option: use local ziti-sdk-c checkout")
set(ZITI_SDK_VERSION "1.0.2" CACHE STRING "ziti-sdk-c version or branch to use")
set(ZITI_SDK_VERSION "1.0.3" CACHE STRING "ziti-sdk-c version or branch to use")

# if TUNNEL_SDK_ONLY then don't descend into programs/ziti-edge-tunnel
option(TUNNEL_SDK_ONLY "build only ziti-tunnel-sdk (without ziti)" OFF)
Expand Down
9 changes: 7 additions & 2 deletions programs/ziti-edge-tunnel/ziti-edge-tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,12 +1835,17 @@ static int init_proxy_connector(const char *url) {

struct tlsuv_url_s proxy_url;
int r = tlsuv_parse_url(&proxy_url, url);
if (r == 0 && proxy_url.scheme != NULL) {
} else {
if (r != 0) {
ZITI_LOG(ERROR, "failed to parse '%s' as 'type://[username[:password]@]hostname:port'", url);
return -1;
}

// assume http if no protocol was specified
if (proxy_url.scheme == NULL) {
proxy_url.scheme = "http";
proxy_url.scheme_len = strlen(proxy_url.scheme);
}

if (strncmp(proxy_url.scheme, "http", proxy_url.scheme_len) != 0) {
ZITI_LOG(ERROR, "proxy type '%.*s' is not supported. 'http' is currently the only supported type",
(int)proxy_url.scheme_len, proxy_url.scheme);
Expand Down
Loading