Added support for self-signed certificates