lzx404243 commented on code in PR #9975:
URL: https://github.com/apache/trafficserver/pull/9975#discussion_r1258400214
##########
plugins/certifier/certifier.cc:
##########
@@ -419,25 +421,25 @@ shadow_cert_generator(TSCont contp, TSEvent event, void
*edata)
/// Try open the file if directory exists
fp = fopen(cert_filename.c_str(), "rt");
}
- TSDebug(PLUGIN_NAME, "shadow_cert_generator(): Cert file is expected at %s",
cert_filename.c_str());
+ TSDebug(PLUGIN_NAME, "%s: cert file is expected at %s", __func__,
cert_filename.c_str());
/// If cert file exists and is readable
if (fp != nullptr) {
cert.reset(PEM_read_X509(fp, nullptr, nullptr, nullptr));
fclose(fp);
if (cert == nullptr) {
/// Problem with cert file / openssl read
- TSError("[%s] [shadow_cert_generator] Problem with loading certs",
PLUGIN_NAME);
+ TSError("[%s] %s: failed to loading certificated from '%s'",
PLUGIN_NAME, __func__, cert_filename.c_str());
Review Comment:
`failed to loading certificated` -> `failed to load certificate`
##########
plugins/certifier/certifier.cc:
##########
@@ -419,25 +421,25 @@ shadow_cert_generator(TSCont contp, TSEvent event, void
*edata)
/// Try open the file if directory exists
fp = fopen(cert_filename.c_str(), "rt");
}
- TSDebug(PLUGIN_NAME, "shadow_cert_generator(): Cert file is expected at %s",
cert_filename.c_str());
+ TSDebug(PLUGIN_NAME, "%s: cert file is expected at %s", __func__,
cert_filename.c_str());
/// If cert file exists and is readable
if (fp != nullptr) {
cert.reset(PEM_read_X509(fp, nullptr, nullptr, nullptr));
fclose(fp);
if (cert == nullptr) {
/// Problem with cert file / openssl read
- TSError("[%s] [shadow_cert_generator] Problem with loading certs",
PLUGIN_NAME);
+ TSError("[%s] %s: failed to loading certificated from '%s'",
PLUGIN_NAME, __func__, cert_filename.c_str());
std::remove(cert_filename.c_str());
} else {
- TSDebug(PLUGIN_NAME, "shadow_cert_generator(): Loaded cert from file");
+ TSDebug(PLUGIN_NAME, "%s: loaded certificates from '%s'", __func__,
cert_filename.c_str());
Review Comment:
I think here we are loading a single certificate so `certificates` ->
`certificate`
##########
tests/gold_tests/pluginTest/certifier/certifier.test.py:
##########
Review Comment:
Looks like the following expectation needs to be updated too:
```
self.ts.Disk.traffic_out.Content += Testers.ContainsExpression(
"Creating shadow certs",
"Verify the certifier plugin generates the certificate
dynamically.")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]