boost::corosio::tls_context::set_verify_callback

Set a custom certificate verification callback.

Synopsis

template<typename Callback>
std::error_code
set_verify_callback(Callback callback);

Description

Installs a callback that is invoked during certificate chain verification. The callback can perform additional validation beyond the standard checks and can override verification results.

The callback receives the verification result so far and information about the certificate being verified. Return true to accept the certificate, false to reject.

The verify_context type provides access to the certificate and chain information. Its exact interface depends on the TLS backend.

Return Value

Success, or an error if the callback could not be set.

Template Parameters

Name Description

Callback

A callable with signature bool( bool preverified, verify_context& ctx ).

Parameters

Name Description

callback

The verification callback.

Created with MrDocs