.\" File automatically generated by doxy2man0.3 .\" Generation date: Thu Sep 3 2026 .TH radcli_ctx_set_secret 3 2026-09-03 "radcli" "Radius client library" .SH "NAME" radcli_ctx_set_secret \- Set the RADIUS shared secret for the configured authserver and/or acctserver. .SH SYNOPSIS .nf .B #include .sp \fBint radcli_ctx_set_secret\fP( \fBradcli_ctx *\fP\fIctx\fP, \fBunsigned \fP\fItarget_mask\fP, \fBconst char *\fP\fIsecret\fP ); .fi .SH DESCRIPTION .PP 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. .SH PARAMETERS .TP .B 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. .TP .B target_mask a bitwise OR of one or both radcli_secret_target values. .TP .B secret the shared secret, as a NUL-terminated string. .SH RETURN VALUE .PP 0 on success, -1 on failure (NULL ctx/secret, target_mask empty or carrying an unrecognised bit, or the corresponding server not yet configured). .SH SEE ALSO .PP .nh .ad l \fIradcli_ctx_apply\fP(3), \fIradcli_ctx_free\fP(3), \fIradcli_ctx_get_opt_int\fP(3), \fIradcli_ctx_get_opt_str\fP(3), \fIradcli_ctx_new\fP(3), \fIradcli_ctx_read_config\fP(3), \fIradcli_ctx_read_dictionary\fP(3), \fIradcli_ctx_read_dictionary_from_buffer\fP(3), \fIradcli_ctx_set_opt_int\fP(3), \fIradcli_ctx_set_opt_str\fP(3), \fIradcli_ctx_set_tls_psk\fP(3) .ad .hy