- Home /
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.
Answer by samizzo · Sep 12, 2017 at 12:29 AM
This maybe isn't the answer you wanted to hear but you can get a free cert from Let's Encrypt.
Your answer
Follow this Question
Related Questions
Problems with TLS handshake 0 Answers
How to use SSL certificates on Android platform within Unity3D? 0 Answers
SSL over socket Remote Certificate Not Available 1 Answer
A nontrivial question: Call server procedure by wamp protocol 0 Answers
Manually validating SSL certificates (no WWW involved) 1 Answer