bool ret = true;
if (!Conf_SSLOptions.DHFile) {
- Log(LOG_NOTICE, "Configuration option \"SSLDHFile\" not set!");
+ Log(LOG_NOTICE, "Configuration option \"DHFile\" not set!");
return false;
}
fp = fopen(Conf_SSLOptions.DHFile, "r");
}
if (need_dhgenerate) {
Log(LOG_WARNING,
- "SSLDHFile not set, generating %u bit DH parameters. This may take a while ...",
+ "DHFile not set, generating %u bit DH parameters. This may take a while ...",
DH_BITS);
err = gnutls_dh_params_generate2(tmp_dh_params, DH_BITS);
if (err < 0) {
bool
ConnSSL_InitLibrary( void )
{
+ if (!Conf_SSLInUse()) {
+ LogDebug("SSL not in use, skipping initialization.");
+ return true;
+ }
+
#ifdef HAVE_LIBSSL
SSL_CTX *newctx;
* According to OpenSSL RAND_egd(3): "The automatic query of /var/run/egd-pool et al was added in OpenSSL 0.9.7";
* so it makes little sense to deal with PRNGD seeding ourselves.
*/
+ array_free(&Conf_SSLOptions.ListenPorts);
return false;
}
newctx = SSL_CTX_new(SSLv23_method());
if (!newctx) {
LogOpenSSLError("SSL_CTX_new()", NULL);
+ array_free(&Conf_SSLOptions.ListenPorts);
return false;
}
return true;
out:
SSL_CTX_free(newctx);
+ array_free(&Conf_SSLOptions.ListenPorts);
return false;
#endif
#ifdef HAVE_LIBGNUTLS
err = gnutls_global_init();
if (err) {
Log(LOG_ERR, "gnutls_global_init(): %s", gnutls_strerror(err));
+ array_free(&Conf_SSLOptions.ListenPorts);
return false;
}
- if (!ConnSSL_LoadServerKey_gnutls())
+ if (!ConnSSL_LoadServerKey_gnutls()) {
+ array_free(&Conf_SSLOptions.ListenPorts);
return false;
+ }
Log(LOG_INFO, "gnutls %s initialized.", gnutls_check_version(NULL));
initialized = true;
return true;
cert_file = Conf_SSLOptions.CertFile ? Conf_SSLOptions.CertFile:Conf_SSLOptions.KeyFile;
if (!cert_file) {
- Log(LOG_NOTICE, "No SSL server key configured, SSL disabled.");
+ Log(LOG_ERR, "No SSL server key configured!");
return false;
}
assert(ctx);
if (!Conf_SSLOptions.KeyFile) {
- Log(LOG_NOTICE, "No SSL server key configured, SSL disabled.");
+ Log(LOG_ERR, "No SSL server key configured!");
return false;
}
assert(ssl);
- Log(LOG_INFO, "New %s connection using cipher %s on socket %d.",
- SSL_get_version(ssl), SSL_get_cipher(ssl), c->sock);
+ Log(LOG_INFO, "Connection %d: initialized %s using cipher %s.",
+ c->sock, SSL_get_version(ssl), SSL_get_cipher(ssl));
#endif
#ifdef HAVE_LIBGNUTLS
gnutls_session_t sess = c->ssl_state.gnutls_session;
gnutls_cipher_algorithm_t cipher = gnutls_cipher_get(sess);
- Log(LOG_INFO, "New %s connection using cipher %s-%s on socket %d.",
+ Log(LOG_INFO, "Connection %d: initialized %s using cipher %s-%s.",
+ c->sock,
gnutls_protocol_get_name(gnutls_protocol_get_version(sess)),
gnutls_cipher_get_name(cipher),
- gnutls_mac_get_name(gnutls_mac_get(sess)), c->sock);
+ gnutls_mac_get_name(gnutls_mac_get(sess)));
#endif
}
#endif /* _GNUTLS */
Conn_OPTION_DEL(c, (CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ|CONN_SSL_CONNECT));
ConnSSL_LogCertInfo(c);
+
+ Conn_StartLogin(CONNECTION2ID(c));
return 1;
}
#endif
}
+#else
+
+bool
+ConnSSL_InitLibrary(void)
+{
+ return true;
+}
#endif /* SSL_SUPPORT */
/* -eof- */