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

Method GetVerifyError

lib/base/tlsstream.cpp:52–66  ·  view source on GitHub ↗

* Returns a human-readable error string for situations where IsVerifyOK() returns false. * * If the handshake was completed and a peer certificate was provided, * the string additionally contains the OpenSSL verification error code. * * @return string containing the error message */

Source from the content-addressed store, hash-verified

50 * @return string containing the error message
51 */
52String UnbufferedAsioTlsStream::GetVerifyError()
53{
54 if (!SSL_is_init_finished(native_handle())) {
55 return "handshake not completed";
56 }
57
58 if (GetPeerCertificate() == nullptr) {
59 return "no peer certificate provided";
60 }
61
62 std::ostringstream buf;
63 long err = SSL_get_verify_result(native_handle());
64 buf << "code " << err << ": " << X509_verify_cert_error_string(err);
65 return buf.str();
66}
67
68std::shared_ptr<X509> UnbufferedAsioTlsStream::GetPeerCertificate()
69{

Callers 7

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

Calls

no outgoing calls

Tested by

no test coverage detected