Tell UnityWebRequest to trust invalid SSL certs

Hi all,

More or less, I have the same question this guy has (and there are others, but none have been answered in Answers or forum posts that I can find):

http://answers.unity3d.com/answers/1247038/view.html

I’d like to use the new UnityWebRequest in UnityEngine.Networking but I don’t know how to tell it to ignore invalid certs. It’s easy to do that with C#'s built in HTTP requests. You just need to tell the ServicePointManager to trust the cert. My dev server has an unsigned cert and I see no need to buy an SSL cert for it since it’s not public-facing.

		ServicePointManager.ServerCertificateValidationCallback = TrustCertificate;

		HttpWebRequest request = (HttpWebRequest) WebRequest.Create( "https://invaliddevcert.com/do_stuff.php?");
		HttpWebResponse response = (HttpWebResponse) request.GetResponse();
            ....

Is there a way for me to convert an HttpWebRequest to a UnityWebRequest object, or somehow extend the UnityWebRequest class to do this?

Thanks.

This maybe isn’t the answer you wanted to hear but you can get a free cert from Let’s Encrypt.