| Home | Libraries | People | FAQ | More

###### ssl_stream::set_verify_callback (2 of 2 overloads)

Set the callback used to verify peer certificates.

<h7> Synopsis </h7>

    template<
        class VerifyCallback>
    void
    set_verify_callback(
        VerifyCallback callback,
        boost::system::error_code& ec);

<h7> Description </h7>

This function is used to specify a callback function that will be called by the implementation when it needs to verify a peer certificate.

<h7> Parameters </h7>

Name | Description
--- | ---

`callback`

The function object to be used for verifying a certificate. The function signature of the handler must be:

     bool verify_callback(
      bool preverified, // True if the certificate passed pre-verification.
      net::verify_context& ctx // The peer certificate and other context.
    );

The return value of the callback is true if the certificate has passed verification, false otherwise.

`ec` | Set to indicate what error occurred, if any.

<h7> Remarks </h7>

Calls `SSL_set_verify`.