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

Function TSSslSecretSet

src/api/InkAPI.cc:8041–8061  ·  view source on GitHub ↗

* This function sets the secret cache value for a given secret name. This allows * plugins to load cert/key PEM information on for use by the TLS core */

Source from the content-addressed store, hash-verified

8039 * plugins to load cert/key PEM information on for use by the TLS core
8040 */
8041TSReturnCode
8042TSSslSecretSet(const char *secret_name, int secret_name_length, const char *secret_data, int secret_data_len)
8043{
8044 TSReturnCode retval = TS_SUCCESS;
8045 std::string const secret_name_str{secret_name, static_cast<unsigned>(secret_name_length)};
8046 SSLConfigParams *load_params = SSLConfig::load_acquire();
8047 SSLConfigParams *params = SSLConfig::acquire();
8048 if (load_params != nullptr) { // Update the current data structure
8049 Dbg(dbg_ctl_ssl_cert_update, "Setting secrets in SSLConfig load for: %.*s", secret_name_length, secret_name);
8050 load_params->secrets.setSecret(secret_name_str, std::string_view(secret_data, secret_data_len));
8051 load_params->updateCTX(secret_name_str);
8052 SSLConfig::load_release(load_params);
8053 }
8054 if (params != nullptr) {
8055 Dbg(dbg_ctl_ssl_cert_update, "Setting secrets in SSLConfig for: %.*s", secret_name_length, secret_name);
8056 params->secrets.setSecret(secret_name_str, std::string_view(secret_data, secret_data_len));
8057 params->updateCTX(secret_name_str);
8058 SSLConfig::release(params);
8059 }
8060 return retval;
8061}
8062
8063TSReturnCode
8064TSSslSecretUpdate(const char *secret_name, int secret_name_length)

Callers 2

CB_Load_SecretFunction · 0.85
CB_Update_SecretFunction · 0.85

Calls 4

acquireFunction · 0.85
releaseFunction · 0.85
setSecretMethod · 0.80
updateCTXMethod · 0.80

Tested by 2

CB_Load_SecretFunction · 0.68
CB_Update_SecretFunction · 0.68