[Tweak] self-signed certificate function