Unbreak self-signed certificate handling