| 37 | DbgCtl dbg_ctl{PLUGIN_NAME}; |
| 38 | |
| 39 | static void |
| 40 | debug_certificate(const char *msg, X509_NAME *name) |
| 41 | { |
| 42 | BIO *bio; |
| 43 | |
| 44 | if (name == nullptr) { |
| 45 | return; |
| 46 | } |
| 47 | |
| 48 | bio = BIO_new(BIO_s_mem()); |
| 49 | if (bio == nullptr) { |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | if (X509_NAME_print_ex(bio, name, 0 /* indent */, XN_FLAG_ONELINE) > 0) { |
| 54 | long len; |
| 55 | char *ptr; |
| 56 | len = BIO_get_mem_data(bio, &ptr); |
| 57 | Dbg(dbg_ctl, "%s %.*s", msg, static_cast<int>(len), ptr); |
| 58 | } |
| 59 | |
| 60 | BIO_free(bio); |
| 61 | } |
| 62 | |
| 63 | int |
| 64 | CB_clientcert(TSCont /* contp */, TSEvent /* event */, void *edata) |