| 61 | } |
| 62 | |
| 63 | int |
| 64 | CB_clientcert(TSCont /* contp */, TSEvent /* event */, void *edata) |
| 65 | { |
| 66 | TSVConn ssl_vc = reinterpret_cast<TSVConn>(edata); |
| 67 | TSSslConnection sslobj = TSVConnSslConnectionGet(ssl_vc); |
| 68 | SSL *ssl = reinterpret_cast<SSL *>(sslobj); |
| 69 | #ifdef OPENSSL_IS_OPENSSL3 |
| 70 | X509 *cert = SSL_get1_peer_certificate(ssl); |
| 71 | #else |
| 72 | X509 *cert = SSL_get_peer_certificate(ssl); |
| 73 | #endif |
| 74 | Dbg(dbg_ctl, "plugin verify_cert verifying client certificate"); |
| 75 | if (cert) { |
| 76 | debug_certificate("client certificate subject CN is %s", X509_get_subject_name(cert)); |
| 77 | debug_certificate("client certificate issuer CN is %s", X509_get_issuer_name(cert)); |
| 78 | X509_free(cert); |
| 79 | } |
| 80 | // All done, reactivate things |
| 81 | TSVConnReenable(ssl_vc); |
| 82 | return TS_SUCCESS; |
| 83 | } |
| 84 | |
| 85 | } // namespace |
| 86 |
nothing calls this directly
no test coverage detected