#include <stdbool.h>
#include "ziti_model.h"
#include <uv.h>
Go to the source code of this file.
◆ ziti_enroll_cb
| typedef void(* ziti_enroll_cb) (const ziti_config *cfg, int status, const char *err_message, void *enroll_ctx) |
Callback called after ziti_enroll() is complete.
This callback is invoked on the conclusion of the ziti_enroll() function. The result of the ziti_enroll() function may be an error condition so it is important to verify the provided status code in this callback.
This callback also receives a Ziti identity json salvo if the enrollment was successful. This identity should be persisted into a file, and used in subsequent calls to ziti_load_config().
- Parameters
-
| cfg | identity config object, NULL if enrollment fails for any reason |
| status | enrollment success or error code |
| err_message | description of error, or NULL if enrollment succeeded |
| enroll_ctx | additional context to be passed into ziti_enroll_cb callback |
- See also
- ziti_enroll(), ZITI_ERRORS
◆ ziti_enroll()
Performs a Ziti enrollment.
This function is used to enroll a Ziti Edge identity. [enroll_cb] is called once enrollment process is complete unless the error is returned.
- Parameters
-
| opts | enrollment options |
| loop | event loop |
| enroll_cb | callback to be called when enrollment is complete |
| enroll_ctx | additional context to be passed into ziti_enroll_cb callback |
- Returns
- ZITI_OK or corresponding #ZITI_ERRORS
◆ ziti_enroll_url()
| int ziti_enroll_url |
( |
const char * |
url, |
|
|
uv_loop_t * |
loop, |
|
|
ziti_enroll_cb |
enroll_cb, |
|
|
void * |
enroll_ctx |
|
) |
| |
|
extern |
Bootstrap a ziti_config from a controller URL.
Fetches the network JWT from the controller's /network-jwts endpoint, verifies the controller identity using the JWT signature, then fetches the CA bundle over the verified connection.
Requires the controller's TLS certificate to be verifiable by the OS trust store (publicly-trusted CA). For privately-signed controllers, obtain the network JWT out of band and pass it via ziti_enroll_opts.token to ziti_enroll() instead.
- Parameters
-
| url | controller URL (e.g., "https://ctrl.example.com:1280") |
| loop | event loop |
| enroll_cb | callback invoked with the bootstrapped config |
| enroll_ctx | additional context passed to the callback |
- Returns
- ZITI_OK or corresponding #ZITI_ERRORS