Add support for self-signed certs
Add test for self-signed cert