bug 893: adjusted preg_match and cert duration check