support certs and add tests