MCPcopy Create free account
hub / github.com/apache/trafficserver / CB_clientcert

Function CB_clientcert

example/plugins/c-api/verify_cert/verify_cert.cc:63–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63int
64CB_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

Callers

nothing calls this directly

Calls 3

TSVConnSslConnectionGetFunction · 0.85
debug_certificateFunction · 0.85
TSVConnReenableFunction · 0.85

Tested by

no test coverage detected