]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ssl: Fix regression about certificates generation
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Jul 2017 14:56:09 +0000 (16:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Jul 2017 16:25:18 +0000 (18:25 +0200)
commit48a8332a4a82f151877bd6baf567031088845f2d
tree1834a5852a66dfbab23276c231bc94c8af422b99
parent7a4a0ac71d51c592f20622d1b5530042ae79f3b9
BUG/MEDIUM: ssl: Fix regression about certificates generation

Since the commit f6b37c67 ["BUG/MEDIUM: ssl: in bind line, ssl-options after
'crt' are ignored."], the certificates generation is broken.

To generate a certificate, we retrieved the private key of the default
certificate using the SSL object. But since the commit f6b37c67, the SSL object
is created with a dummy certificate (initial_ctx).

So to fix the bug, we use directly the default certificate in the bind_conf
structure. We use SSL_CTX_get0_privatekey function to do so. Because this
function does not exist for OpenSSL < 1.0.2 and for LibreSSL, it has been added
in openssl-compat.h with the right #ifdef.
include/proto/openssl-compat.h
src/ssl_sock.c