Try more options to get hostname for the self-signed certificate.