Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches

◆ serverCertificateValidationCallback

std::function<bool(CtxtHandle context, const ConnectionInfoPtr& info)> Ice::SSL::SchannelClientAuthenticationOptions::serverCertificateValidationCallback

A callback for validating the server certificate chain.

If the verification callback returns false, the connection will be aborted with an Ice::SecurityException.

When this callback is set, it replaces the default validation callback and must perform all necessary validation steps.

Example of setting serverCertificateValidationCallback:

auto initData = Ice::InitializationData{
.clientAuthenticationOptions = Ice::SSL::ClientAuthenticationOptions{
.serverCertificateValidationCallback =
[](CtxtHandle, const Ice::SSL::ConnectionInfoPtr&) { return true; }}};
Parameters
contextAn opaque object representing the security context associated with the current connection. This context contains security data relevant for validation, such as the server's certificate chain and cipher suite.
infoThe connection info object that provides additional connection-related data. The ConnectionInfo type is an alias for the platform-specific connection info class.
Returns
true if the certificate chain is valid and the connection should proceed; false if the certificate chain is invalid and the connection should be aborted.
Exceptions
Ice::SecurityExceptionif the certificate chain is invalid and the connection should be aborted.
See also
SSL::OpenSSLConnectionInfo
SSL::SecureTransportConnectionInfo
SSL::SchannelConnectionInfo

Definition at line 85 of file ClientAuthenticationOptions.h.