diff options
author | Igor Sysoev <igor@sysoev.ru> | 2018-09-20 15:05:37 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2018-09-20 15:05:37 +0300 |
commit | 96cd68b34037f8b6d9a1d43f67b8fe7c1df2ef9e (patch) | |
tree | 8e648712993012fbe815cc92e6debab20449fe8f /src/nxt_router.c | |
parent | e964e982fd64505fb8644f91e5c57a869038cd18 (diff) | |
download | unit-96cd68b34037f8b6d9a1d43f67b8fe7c1df2ef9e.tar.gz unit-96cd68b34037f8b6d9a1d43f67b8fe7c1df2ef9e.tar.bz2 |
Added SSL/TLS support on connection level.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r-- | src/nxt_router.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index df5b7466..87721ba4 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -299,6 +299,18 @@ nxt_router_start(nxt_task_t *task, void *data) rt = task->thread->runtime; +#if (NXT_TLS) + rt->tls = nxt_service_get(rt->services, "SSL/TLS", "OpenSSL"); + if (nxt_slow_path(rt->tls == NULL)) { + return NXT_ERROR; + } + + ret = rt->tls->library_init(task); + if (nxt_slow_path(ret != NXT_OK)) { + return ret; + } +#endif + ret = nxt_http_init(task, rt); if (nxt_slow_path(ret != NXT_OK)) { return ret; @@ -2773,6 +2785,12 @@ nxt_router_conf_release(nxt_task_t *task, nxt_socket_conf_joint_t *joint) if (rtcf != NULL) { nxt_debug(task, "old router conf is destroyed"); +#if (NXT_TLS) + if (skcf->tls != NULL) { + task->thread->runtime->tls->server_free(task, skcf->tls); + } +#endif + nxt_router_access_log_release(task, lock, rtcf->access_log); nxt_mp_thread_adopt(rtcf->mem_pool); |