ZyklonB: make client certificates actually work

We forgot to set the private key, which can reside in the same file
as the certificate, appended at the end.
This commit is contained in:
Přemysl Eric Janouch 2014-08-13 19:23:09 +02:00
parent 946522ba80
commit d4e4f599f0

View File

@ -282,7 +282,8 @@ irc_initialize_ssl (struct bot_context *ctx, struct error **e)
if (!path) if (!path)
print_error ("%s: %s", "cannot open file", ssl_cert); print_error ("%s: %s", "cannot open file", ssl_cert);
// XXX: perhaps we should read the file ourselves for better messages // XXX: perhaps we should read the file ourselves for better messages
else if (!SSL_use_certificate_file (ctx->ssl, path, SSL_FILETYPE_PEM)) else if (!SSL_use_certificate_file (ctx->ssl, path, SSL_FILETYPE_PEM)
|| !SSL_use_PrivateKey_file (ctx->ssl, path, SSL_FILETYPE_PEM))
print_error ("%s: %s", "setting the SSL client certificate failed", print_error ("%s: %s", "setting the SSL client certificate failed",
ERR_error_string (ERR_get_error (), NULL)); ERR_error_string (ERR_get_error (), NULL));
free (path); free (path);