Fix commonName check in the auto-discovery script.

Refs #4865
Fix the spec file.

Refs #4865