It appears that you want add_certificate_authority()
:
This function is used to add one trusted certification authority from a memory buffer.
use_certificate()
and use_certificate_file()
are for the server or client certificate presented in the handshake, i.e. not the CA used to test those certificates.
These functions (load_verify_file()
and add_certificate_authority()
) are not consistently named. I guess it is because the memory buffer versions were added relatively recently.