boost::corosio::tls_context::use_certificate_file

Load the entity certificate from a file.

Synopsis

std::error_code
use_certificate_file(
    std::string_view filename,
    tls_file_format format);

Description

Sets the certificate that identifies this endpoint to the peer. For servers, this is the server certificate. For clients using mutual TLS, this is the client certificate.

Example

ctx.use_certificate_file( "server.crt", tls_file_format::pem );

Return Value

Success, or an error if the file could not be read or the certificate is invalid.

Parameters

Name Description

filename

Path to the certificate file.

format

The encoding format of the file.

See Also

use_certificate

use_private_key_file

Created with MrDocs