BUG/MEDIUM: ssl: never generates the chain from the verify store
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 12 Aug 2020 18:02:10 +0000 (20:02 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 12 Aug 2020 18:10:50 +0000 (20:10 +0200)
commit935d8294d5a4671ec01256b4129b5bc3ce5ab00e
treeec2804e83b3fa28876b6ac37839fdec4b51c944e
parenta6d9879e69d65e8821347860394829c4dc72f937
BUG/MEDIUM: ssl: never generates the chain from the verify store

In bug #781 it was reported that HAProxy completes the certificate chain
using the verify store in the case there is no chain.

Indeed, according to OpenSSL documentation, when generating the chain,
OpenSSL use the chain store OR the verify store in the case there is no
chain store.

As a workaround, this patch always put a NULL chain in the SSL_CTX so
OpenSSL does not tries to complete it.

This must be backported in all branches, the code could be different,
the important part is to ALWAYS set a chain, and uses sk_X509_new_null()
if the chain is NULL.
src/ssl_sock.c