Why do we bypass the built-in certificate check and take over control. This problem still occurs by returning true from the handler.
UnityWebRequest request = UnityWebRequest.Post(url, form);
request.SetRequestHeader(“Accept”, “application/json”);
request.SetRequestHeader(“SnMac”, LoadManager.deviceUniqueIdentifier);
if (isToken)
request.SetRequestHeader(“Authorization”, "Bearer " + LoadManager.userData.data.token);
request.certificateHandler = new WebRequestCert();
public class WebRequestCert : UnityEngine.Networking.CertificateHandler
{
protected override bool ValidateCertificate(byte[ ] certificateData)
{
//return base.ValidateCertificate(certificateData);
return true;
}
}
Networking, UnityWebRequest, WWW, Postman, curl, WebAPI, etc:
And setting up a proxy can be very helpful too, in order to compare traffic: