Skip to content

Commit

Permalink
Merge pull request #1100 from openziti/ziti-sdk-1.5.0
Browse files Browse the repository at this point in the history
update ziti-sdk-1.5.0
  • Loading branch information
ekoby authored Feb 13, 2025
2 parents 17a6f96 + fc56956 commit 30f93d4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
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.21)


set(ZITI_SDK_DIR "" CACHE FILEPATH "developer option: use local ziti-sdk-c checkout")
set(ZITI_SDK_VERSION "1.4.4" CACHE STRING "ziti-sdk-c version or branch to use")
set(ZITI_SDK_VERSION "1.5.0" 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
19 changes: 9 additions & 10 deletions lib/ziti-tunnel-cbs/ziti_hosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,13 +759,12 @@ static void hosted_listen_cb(ziti_connection serv, int status) {
}
}

static ziti_listen_opts DEFAULT_LISTEN_OPTS = {
.bind_using_edge_identity = false,
.identity = NULL,
.connect_timeout_seconds = 5,
.terminator_precedence = PRECEDENCE_DEFAULT,
.terminator_cost = 0,
};
#define DEFAULT_LISTEN_OPTS (ziti_listen_opts){ \
.bind_using_edge_identity = false, \
.identity = NULL, \
.connect_timeout_seconds = 5, \
.terminator_precedence = PRECEDENCE.DEFAULT, \
.terminator_cost = 0, }

static void listen_opts_from_host_cfg_v1(ziti_listen_opts *opts, const ziti_host_cfg_v1 *config) {
*opts = DEFAULT_LISTEN_OPTS;
Expand All @@ -779,11 +778,11 @@ static void listen_opts_from_host_cfg_v1(ziti_listen_opts *opts, const ziti_host
const char *prec = config->listen_options->precendence;
if (prec) {
if (strcmp(prec, "default") == 0) {
opts->terminator_precedence = PRECEDENCE_DEFAULT;
opts->terminator_precedence = PRECEDENCE.DEFAULT;
} else if (strcmp(prec, "required") == 0) {
opts->terminator_precedence = PRECEDENCE_REQUIRED;
opts->terminator_precedence = PRECEDENCE.REQUIRED;
} else if (strcmp(prec, "failed") == 0) {
opts->terminator_precedence = PRECEDENCE_FAILED;
opts->terminator_precedence = PRECEDENCE.FAILED;
} else {
ZITI_LOG(WARN, "unsupported terminator precedence '%s'", prec);
}
Expand Down
6 changes: 5 additions & 1 deletion lib/ziti-tunnel-cbs/ziti_tunnel_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#define HOST_NAME_MAX 254
#endif

// renew identity certificate if expired/expiring in the next 30 days
#define CERT_EXT_WINDOW 30

#define FREE(x) do { if(x) free((void*)(x)); (x) = NULL; } while(0)

// temporary list to pass info between parse and run
Expand Down Expand Up @@ -835,7 +838,8 @@ static int load_identity_cfg(const char *identifier, const ziti_config *cfg, boo
ziti_options opts = {
.api_page_size = api_page_size > 0 ? api_page_size : 0,
.disabled = disabled,
.refresh_interval = (long)refresh_interval
.refresh_interval = (long)refresh_interval,
.cert_extension_window = CERT_EXT_WINDOW,
};
int rc = init_ziti_instance(inst, cfg, &opts);
if (rc != ZITI_OK) {
Expand Down

0 comments on commit 30f93d4

Please sign in to comment.