Hi all,
When my project was on Unity2017.4.21f1, it was working.
After upgrade to 2018.3.11f1 it started to give “Unknown Error”
Here is my code
WWWForm form = new WWWForm();
form.AddField("email", email_id);
form.AddField("password", password);
UnityWebRequest www2 = UnityWebRequest.Post("https://api.var-port.com/api/v1/login", form);
www2.chunkedTransfer = true;
yield return www2.SendWebRequest();
Debug.Log("Error : " + www2.error);
Debug.Log("downloadHandler Text : " + www2.downloadHandler.text);
Debug.Log("responseCode : " + www2.responseCode);
Debug.Log("isDone : " + www2.isDone);
Debug.Log("method : " + www2.method);
It gives:
Error : Unknown Error
downloadHandler Text :
responseCode : 0
isDone : True
method : POST
I searched on Google and Unity forms and found some solutions.
I also tried
class AcceptAllCertificatesSignedWithASpecificKeyPublicKey : CertificateHandler
{
// Encoded RSAPublicKey
private static string PUB_KEY = "MyLongKEYString";
protected override bool ValidateCertificate(byte[] certificateData)
{
X509Certificate2 certificate = new X509Certificate2(certificateData);
string pk = certificate.GetPublicKeyString();
if (pk.ToLower().Equals(PUB_KEY.ToLower()))
return true;
return false;
}
}
and
class NoCheckCertificatePolicy : System.Net.ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
{
return true;
}
}
But nothing changes.
Do you have any solutions for that on server or in Unity?
Thanks