Add OFTC and refactor the cert support