fix bug in certificate regexp match