From 3765a1b266c9a84be74c53713cfb6c555a37d759 Mon Sep 17 00:00:00 2001 From: Rohit Mathulla Date: Fri, 24 Apr 2015 15:48:30 +1000 Subject: [PATCH] openssl: Read cert from private key file when needed * src/openssl.c (ssl_init): Assign opt.cert_{file, type} from opt.private_key(_type) --- src/openssl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openssl.c b/src/openssl.c index b6cdb8dc..3ac0f44c 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -296,6 +296,13 @@ ssl_init (void) opt.private_key_type = opt.cert_type; } + /* Use cert from private key file unless otherwise specified. */ + if (opt.private_key && !opt.cert_file) + { + opt.cert_file = xstrdup (opt.private_key); + opt.cert_type = opt.private_key_type; + } + if (opt.cert_file) if (SSL_CTX_use_certificate_file (ssl_ctx, opt.cert_file, key_type_to_ssl_type (opt.cert_type))