summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_openssl.c')
-rw-r--r--src/nxt_openssl.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/nxt_openssl.c b/src/nxt_openssl.c
index 1e08015e..59c58b2b 100644
--- a/src/nxt_openssl.c
+++ b/src/nxt_openssl.c
@@ -644,16 +644,10 @@ nxt_tls_ticket_keys(nxt_task_t *task, SSL_CTX *ctx, nxt_tls_init_t *tls_init,
return NXT_OK;
}
- if (nxt_conf_type(tickets_conf) == NXT_CONF_ARRAY) {
- count = nxt_conf_array_elements_count(tickets_conf);
+ count = nxt_conf_array_elements_count_or_1(tickets_conf);
- if (count == 0) {
- goto no_ticket;
- }
-
- } else {
- /* nxt_conf_type(tickets_conf) == NXT_CONF_STRING */
- count = 1;
+ if (count == 0) {
+ goto no_ticket;
}
#ifdef SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB
@@ -673,15 +667,9 @@ nxt_tls_ticket_keys(nxt_task_t *task, SSL_CTX *ctx, nxt_tls_init_t *tls_init,
i++;
- if (nxt_conf_type(tickets_conf) == NXT_CONF_ARRAY) {
- member = nxt_conf_get_array_element(tickets_conf, count - i);
- if (member == NULL) {
- break;
- }
-
- } else {
- /* nxt_conf_type(tickets_conf) == NXT_CONF_STRING */
- member = tickets_conf;
+ member = nxt_conf_get_array_element_or_itself(tickets_conf, count - i);
+ if (member == NULL) {
+ break;
}
nxt_conf_get_string(member, &value);