
Using SSL_CTX_use_certificate_chain_file instead of SSL_CTX_use_certificate_file allows the use of certificate chains. This is the method that the OpenSSL documentation recommends: https://wiki.openssl.org/index.php/Manual%3ASSL_CTX_use_certificate%283%29