On Wed, Mar 3, 2021 at 11:17 AM Stefan Eissing <stefan.eiss...@greenbytes.de> wrote: > > > Am 03.03.2021 um 11:14 schrieb Yann Ylavic <ylavic....@gmail.com>: > > > > Possibly apr_array_header_t could do it too: > > AP_DECLARE(int) ap_ssl_answer_challenge(conn_rec *c, const char > > *server_name, const apr_array_header_t **pcertificate_key_pem); > > ? > > as in apr_array_make(p, len, sizeof(char))?
IIIC, ap_ssl_answer_challenge() would populate pcertificate_key_pem, so would be something like: * caller: apr_array_header_t *pems = NULL; ap_ssl_answer_challenge(c, server_name, &pems); for (int i = 0; i < pems->nelts; ++i) { const char *pem = APR_ARRAY_IDX(pems, i, const char*); /* play with pem */ } * ap_ssl_answer_challenge(apr_array_header_t **ppems): apr_array_header_t *pems = *ppems = apr_array_make(p, 10, sizeof(const char*)); foreach pem from ssl structure { APR_ARRAY_PUSH(pems, const char *) = pem; } or so..