- Home /
Curl error 60: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_EXPIRED SSL CA certificate error
Hey guys,
I got the weirdest behaviour. My app uses a backend system that worked fine up until it gives this error.
This error is given when loging in. I send a unique device ID to the backend, the backend returns success or fail and the relevant credentials to start the session.
The weird part is that this error only happens on some android devices. The unique ID I send to the backend is the IMEI number on android. On pc, the backend works fine and also on some android devices. I have not seen posts about Curl error 60, only Curl error 51.
Unity version used: 2020.3.15f2
Thank you for any help on this.
Answer by paulsz · Dec 09, 2021 at 10:47 AM
Found an answer, probably not really safe or correct but if anyone needs:
Create
public class CertificateWhore : CertificateHandler
{
protected override bool ValidateCertificate(byte[] certificateData)
{
return true;
}
}
and for each web request you make, you have to set the certificate handler that always validates the certificate.
var request = UnityWebRequest.Delete(API + aCommand);
request.certificateHandler = new CertificateWhore();
hope this helps someone.
You may have setup your certificate chain wrongly or incomplete. You can use this website to check your certificate chain and it can also create a proper chain certificate which includes all intermediate certificates.
When I test my own domain it tells me I have the correct chain since I use a lets encrypt certificate. If the page tells you anything else, your chain is most likely incomplete. Some platforms / clients may search for the missing intermediate certificates themselfs or just have those particular intermediate certs already cached from other requests. However your certificate should include all intermediate certs as well.
Tested and it works! (july of 2022) In my case i was making request to a private network (Ex: https://192.168.90.241:7788/DevicePublicInfo) Thank you very much, you are an ass saver!
Your answer
![](https://koobas.hobune.stream/wayback/20220613045955im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Facebook for Android SSL Problem 0 Answers
Error loading page? How do i resolve? 0 Answers