* Checks whether the TLS handshake was completed with a valid peer certificate. * * @return true if the peer presented a valid certificate, false otherwise */
| 27 | * @return true if the peer presented a valid certificate, false otherwise |
| 28 | */ |
| 29 | bool 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. |
no outgoing calls
no test coverage detected