Called by ATS as our initialization point
| 86 | |
| 87 | // Called by ATS as our initialization point |
| 88 | void |
| 89 | TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */) |
| 90 | { |
| 91 | bool success = false; |
| 92 | TSPluginRegistrationInfo info; |
| 93 | TSCont cb_cert = nullptr; // Certificate callback continuation |
| 94 | |
| 95 | info.plugin_name = PLUGIN_NAME; |
| 96 | info.vendor_name = "Apache Software Foundation"; |
| 97 | info.support_email = "dev@trafficserver.apache.org"; |
| 98 | |
| 99 | if (TS_SUCCESS != TSPluginRegister(&info)) { |
| 100 | TSError(PCP "registration failed"); |
| 101 | } else if (nullptr == (cb_cert = TSContCreate(&CB_clientcert, TSMutexCreate()))) { |
| 102 | TSError(PCP "Failed to create cert callback"); |
| 103 | } else { |
| 104 | TSHttpHookAdd(TS_SSL_VERIFY_CLIENT_HOOK, cb_cert); |
| 105 | success = true; |
| 106 | } |
| 107 | |
| 108 | if (!success) { |
| 109 | TSError(PCP "not initialized"); |
| 110 | } |
| 111 | Dbg(dbg_ctl, "Plugin %s", success ? "online" : "offline"); |
| 112 | |
| 113 | return; |
| 114 | } |
nothing calls this directly
no test coverage detected