certificate chains are really necessary when using officially signed certificates by well known CAs that use intermediate certificates (and you don't want to have to have each client include the CAs intermediate certificates in the client configuration, which is the whole reason for using officially signed certificates).
This should be a quick fix - on line
|
if(SSL_CTX_use_certificate_file(tls_ctx, cert_file.c_str(), SSL_FILETYPE_PEM) <= 0) { |
- it currently uses
SSL_CTX_use_certificate_file but can be switched to use
SSL_CTX_use_certificate_chain_file
The documentation (Notes section) https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_use_certificate_chain_file.html describes why SSL_CTX_use_certificate_chain_file() should be preferred