+#ifdef WANT_IPV6
+#define DEFAULT_LISTEN_ADDRSTR "::,0.0.0.0"
+#else
+#define DEFAULT_LISTEN_ADDRSTR "0.0.0.0"
+#endif
+
+#ifdef SSL_SUPPORT
+struct SSLOptions Conf_SSLOptions;
+
+static void
+ConfSSL_Init(void)
+{
+ free(Conf_SSLOptions.KeyFile);
+ Conf_SSLOptions.KeyFile = NULL;
+
+ free(Conf_SSLOptions.CertFile);
+ Conf_SSLOptions.CertFile = NULL;
+
+ free(Conf_SSLOptions.DHFile);
+ Conf_SSLOptions.DHFile = NULL;
+ array_free_wipe(&Conf_SSLOptions.KeyFilePassword);
+}
+
+static bool
+can_open(const char *name, const char *file)
+{
+ FILE *fp = fopen(file, "r");
+ if (fp)
+ fclose(fp);
+ else
+ fprintf(stderr, "ERROR: %s \"%s\": %s\n",
+ name, file, strerror(errno));
+ return fp != NULL;
+}
+
+static bool
+ConfSSL_Puts(void)
+{
+ bool ret = true;
+
+ if (Conf_SSLOptions.KeyFile) {
+ printf( " SSLKeyFile = %s\n", Conf_SSLOptions.KeyFile);
+ ret = can_open("SSLKeyFile", Conf_SSLOptions.KeyFile);
+ }
+ if (Conf_SSLOptions.CertFile) {
+ printf( " SSLCertFile = %s\n", Conf_SSLOptions.CertFile);
+ if (!can_open("SSLCertFile", Conf_SSLOptions.CertFile))
+ ret = false;
+ }
+ if (Conf_SSLOptions.DHFile) {
+ printf( " SSLDHFile = %s\n", Conf_SSLOptions.DHFile);
+ if (!can_open("SSLDHFile", Conf_SSLOptions.DHFile))
+ ret = false;
+ }
+ if (array_bytes(&Conf_SSLOptions.KeyFilePassword))
+ puts(" SSLKeyFilePassword = <secret>" );
+ array_free_wipe(&Conf_SSLOptions.KeyFilePassword);
+
+ return ret;
+}
+#endif