Fixes #6566 - If the certname does not match the hostname, nil the certname

Resolves http://projects.theforeman.org/issues/6566 by generalizing the solution from http://projects.theforeman.org/issues/3222
I removed 'UUID' from the comment and rebased.