RajaMuhammadAwais commented on code in PR #13584:
URL: https://github.com/apache/trafficserver/pull/13584#discussion_r3872684525


##########
tests/gold_tests/pluginTest/cert_update/cert_update.test.py:
##########
@@ -99,6 +99,19 @@
 ts.Disk.traffic_out.Content = "gold/update.gold"
 ts.StillRunningAfter = server
 
+# Server-Cert-Update-No-CN
+# A certificate without a common name must be rejected without crashing ATS.
+tr = Test.AddTestRun("Server-Cert-Update-No-CN")
+tr.Processes.Default.Env = ts.Env
+tr.Processes.Default.Command = (
+    'openssl req -x509 -newkey rsa:2048 -nodes -keyout {0}/no-cn.key -out 
{0}/no-cn.crt '
+    '-subj /O=NoCN -days 1 >/dev/null 2>&1 && '
+    'cat {0}/no-cn.key {0}/no-cn.crt > {0}/no-cn.pem && '
+    '{1}/traffic_ctl plugin msg cert_update.server 
{0}/no-cn.pem'.format(ts.Variables.SSLDir, ts.Variables.BINDIR))
+ts.Disk.traffic_out.Content = "gold/update-no-cn.gold"

Review Comment:
   Thanks for the detailed review. I removed the unused gold file, switched the 
testers to additive `+=` with `Testers.ContainsExpression`, added 
`tr.StillRunningAfter = ts`, and changed the lookup to `find(common_name_str)`. 
These fixes have been pushed to the existing PR branch.



-- 
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]

Reply via email to