X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconf.c;h=929ab05403734b8cd43e851955828072c38a0e33;hp=d5a28bd7bfbe25ab3b8268781236edfe663954f2;hb=ab009976984ede815c31c9a6b318c80006823b81;hpb=b4966aa1bd8d11ed2bc97cc5fea418fab3485b08 diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index d5a28bd7..929ab054 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -109,6 +109,28 @@ ConfSSL_Init(void) array_free(&Conf_SSLOptions.ListenPorts); } +/** + * Check if the current configuration uses/requires SSL. + * + * @returns true if SSL is used and should be initialized. + */ +GLOBAL bool +Conf_SSLInUse(void) +{ + int i; + + /* SSL listen ports configured? */ + if (array_bytes(&Conf_SSLOptions.ListenPorts)) + return true; + + for (i = 0; i < MAX_SERVERS; i++) { + if (Conf_Server[i].port > 0 + && Conf_Server[i].SSLConnect) + return true; + } + return false; +} + /** * Make sure that a configured file is readable. *