strarr_push(&conf_argv, input->extra_modules[i]);
}
}
- if (service->want_ssl_settings &&
- (input->module != NULL || input->extra_modules != NULL)) {
+ if (input->module != NULL || input->extra_modules != NULL) {
strarr_push(&conf_argv, "-m");
- strarr_push(&conf_argv, "ssl-server");
+ if (service->want_ssl_server)
+ strarr_push(&conf_argv, "ssl-server");
+ else
+ strarr_push(&conf_argv, "ssl");
}
if (input->parse_full_config)
strarr_push(&conf_argv, "-p");
for (unsigned int i = 0; input->extra_modules[i] != NULL; i++)
str_printfa(str, "\tmodule=%s", input->extra_modules[i]);
}
- if (service->want_ssl_settings &&
- (input->module != NULL || input->extra_modules != NULL))
- str_append(str, "\tmodule=ssl-server");
+ if (input->module != NULL || input->extra_modules != NULL) {
+ str_printfa(str, "\tmodule=%s",
+ service->want_ssl_server ? "ssl-server" : "ssl");
+ }
if (input->service != NULL)
str_printfa(str, "\tservice=%s", input->service);
if (input->username != NULL)
p_array_init(&all_roots, service->set_pool, 8);
tmp_root = &master_service_setting_parser_info;
array_push_back(&all_roots, &tmp_root);
- if (service->want_ssl_settings) {
- tmp_root = &master_service_ssl_setting_parser_info;
- array_push_back(&all_roots, &tmp_root);
+ tmp_root = &master_service_ssl_setting_parser_info;
+ array_push_back(&all_roots, &tmp_root);
+ if (service->want_ssl_server) {
tmp_root = &master_service_ssl_server_setting_parser_info;
array_push_back(&all_roots, &tmp_root);
}
void **master_service_settings_parser_get_others(struct master_service *service,
const struct setting_parser_context *set_parser)
{
- return settings_parser_get_list(set_parser) + 1 +
- (service->want_ssl_settings ? 2 : 0);
+ return settings_parser_get_list(set_parser) + 2 +
+ (service->want_ssl_server ? 1 : 0);
}
struct setting_parser_context *
T_BEGIN {
master_service_init_socket_listeners(service);
} T_END;
- service->want_ssl_settings = service->want_ssl_server ||
- (service->flags & MASTER_SERVICE_FLAG_USE_SSL_SETTINGS) != 0;
#ifdef HAVE_SSL
- /* load SSL module if necessary */
- if (service->want_ssl_settings) {
+ /* Load the SSL module if we already know it is necessary. It can also
+ get loaded later on-demand. */
+ if (service->want_ssl_server) {
const char *error;
if (ssl_module_load(&error) < 0)
i_fatal("Cannot load SSL module: %s", error);