radcli_ctx_set_secret(3) Radius client library radcli_ctx_set_secret(3) NAME radcli_ctx_set_secret - Set the RADIUS shared secret for the configured authserver and/or acctserver. SYNOPSIS #include int radcli_ctx_set_secret( radcli_ctx *ctx, unsigned target_mask, const char *secret ); DESCRIPTION The equivalent, for the new API, of embedding a secret in the host:port:secret form of #RADCLI_OPT_AUTHSERVER/#RADCLI_OPT_ACCTSERVER's value but as a distinct call instead of a delimited string, and able to set both server types' secret at once when they share one (the usual case) via RADCLI_SECRET_AUTH | RADCLI_SECRET_ACCT, without embedding anything in the authserver/acctserver value at all. PARAMETERS ctx a context whose #RADCLI_OPT_AUTHSERVER and/or #RADCLI_OPT_ACCTSERVER (per target_mask) is already set via radcli_ctx_set_opt_str() or radcli_ctx_read_config() before this call. target_mask a bitwise OR of one or both radcli_secret_target values. secret the shared secret, as a NUL-terminated string. RETURN VALUE 0 on success, -1 on failure (NULL ctx/secret, target_mask empty or carrying an unrecognised bit, or the corresponding server not yet configured). SEE ALSO radcli_ctx_apply(3), radcli_ctx_free(3), radcli_ctx_get_opt_int(3), radcli_ctx_get_opt_str(3), radcli_ctx_new(3), radcli_ctx_read_config(3), radcli_ctx_read_dictionary(3), radcli_ctx_read_dictionary_from_buffer(3), radcli_ctx_set_opt_int(3), radcli_ctx_set_opt_str(3), radcli_ctx_set_tls_psk(3) radcli 2026-09-03 radcli_ctx_set_secret(3)