Explicitly end stdin streams

in case provided input doesn't include needed newline characters
Fix verifyCertificate regexes

can't rely on newlines being there