MCPcopy Create free account
hub / github.com/Icinga/icinga2 / IsVerifyOK

Method IsVerifyOK

lib/base/tlsstream.cpp:29–42  ·  view source on GitHub ↗

* Checks whether the TLS handshake was completed with a valid peer certificate. * * @return true if the peer presented a valid certificate, false otherwise */

Source from the content-addressed store, hash-verified

27 * @return true if the peer presented a valid certificate, false otherwise
28 */
29bool UnbufferedAsioTlsStream::IsVerifyOK()
30{
31 if (!SSL_is_init_finished(native_handle())) {
32 // handshake was not completed
33 return false;
34 }
35
36 if (GetPeerCertificate() == nullptr) {
37 // no peer certificate was sent
38 return false;
39 }
40
41 return SSL_get_verify_result(native_handle()) == X509_V_OK;
42}
43
44/**
45 * Returns a human-readable error string for situations where IsVerifyOK() returns false.

Callers 8

ConnectMethod · 0.80
ReconnectInternalMethod · 0.80
ConnectMethod · 0.80
ConnectMethod · 0.80
DoIfwNetIoFunction · 0.80
ConnectMethod · 0.80
TlsStreamFixtureMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected