diff --git a/bin/named/main.c b/bin/named/main.c index fcca97ecfa..7d44c43a92 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -274,11 +274,6 @@ setup() { if (result != ISC_R_SUCCESS) ns_main_earlyfatal("ns_server_init() failed: %s", isc_result_totext(result)); - - result = dns_tsig_init(ns_g_mctx); - if (result != ISC_R_SUCCESS) - ns_main_earlyfatal("dns_tsig_init() failed: %s", - isc_result_totext(result)); } static void diff --git a/bin/named/server.c b/bin/named/server.c index f1ce790733..2491c3e31c 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -360,13 +361,23 @@ load_configuration(const char *filename) { if (oconfigctx != NULL) dns_c_ctx_delete(ns_g_lctx, &oconfigctx); + /* + * Load the TSIG information from the configuration + */ + result = dns_tsig_init(ns_g_confctx, ns_g_mctx); + if (result != ISC_R_SUCCESS) + ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE, + "dns_tsig_init() failed: %s", + isc_result_totext(result)); + /* * Load the TKEY information from the configuration */ result = dns_tkey_init(ns_g_lctx, ns_g_confctx, ns_g_mctx); if (result != ISC_R_SUCCESS) { ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE, - "TKEY init failed"); + "dns_tkey_init() failed: %s", + isc_result_totext(result)); } }