aboutsummaryrefslogtreecommitdiff
path: root/zyklonb.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-08-13 19:23:09 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-08-13 19:23:09 +0200
commitd4e4f599f052b2639ebd111330657294dff1c146 (patch)
treeb34af0af2ed1c4154722e01dd165de87b415a987 /zyklonb.c
parent946522ba8055589b3eb47e925c66544c115a1673 (diff)
downloadxK-d4e4f599f052b2639ebd111330657294dff1c146.tar.gz
xK-d4e4f599f052b2639ebd111330657294dff1c146.tar.xz
xK-d4e4f599f052b2639ebd111330657294dff1c146.zip
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.
Diffstat (limited to 'zyklonb.c')
-rw-r--r--zyklonb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/zyklonb.c b/zyklonb.c
index 10df9b0..47533f0 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -282,7 +282,8 @@ irc_initialize_ssl (struct bot_context *ctx, struct error **e)
if (!path)
print_error ("%s: %s", "cannot open file", ssl_cert);
// 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",
ERR_error_string (ERR_get_error (), NULL));
free (path);