This will replace the two or three kludgy methods in CertificateManager
that currently validate hostnames. In the process it fixes some fun
problems that could arise if the subject of a certificate contained
regex quote sequences (\Q...\E).
Issue #806