Hello everyone! Today, some Android users cannot play my online game. They write connection error messages. I have checked the logs and this error is - Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_EXPIRED
What to do now? Some of the players continue to play and do not know the problem, and some have now encountered this error.
P.S. From a pc I do not have such a problem, from a build on android I get this problem and cannot connect to the server.
We have the same problem. Using Unity 2019.4.20f1, Addressables 1.18.13 and Unity Cloud Content Delivery.
The problem started between Sep 30th and Oct 1st for us. It seems to be related to the Android version installed on the device. It seems Android devices with Android 7.0 trigger this issue, while devices running Android 9 and newer don’t. I don’t know about Android 8.
It looks like the error is triggered when Addressables is initializing and trying to access Unity Cloud Content Delivery. Every Addressables request then results in the Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_EXPIRED error.
[quote=Aurimas-Cernius, post: 7537964, member: 308146]
Strange. Does PC and android do requests to the same URL?
Can you check the entire certificate chain in your browser?
[/quote]
The URL is the same. Peter77 wrote correctly, I have the same problem with him.
Hello! You are right, apparently that is why some of the android devices do not have an error, and some, like mine, have an error! I have android 7.0 and just this error occurs.
This error indicates an expired certificate. Possibly newer Androids have updated certificate in their stores, so everything works, while older ones have expired certificate in there, so you get this error, which is actually perfectly valid.
We started receiving this error yesterday, users reported the connection error message earlier and yesterday our own devices started to show the message too. We have our app connect to our server, but in the Unity Editor and some newer versions of Android is working fine. In our devices the message was showed with Android versions 4.4.4, 7.0 and 6.0.1.
I’ve performed the Charles Proxy capture, it was the first time I’ve done it, so I’m not sure it’s right or what to look at, I’ve generated a file of the session if you want to take a look.
Thank you for the capture. Is this from an Android device? Did you see the error on your device during the capture? I’m not seeing any issues in the capture, although it is still encrypted. We might need an unencrypted capture, ensure to install the local root certificate as mentioned in the article and reboot. For Android, you’ll need to add charlesproxy.unitypackage and create a new build. You can remove the package prior to release.
Yes, the capture was from an Android Device, and the error appeared too. I’ve installed the Unity package and created a new build, but I don’t see any differences on the capture. https://we.tl/t-ugUcY68MHM
The first file is the same I’ve send you before, the others are with the new build. Both times the connection error appeared on the apk.
Got it. Any clue or ideas of what could be causing this error then? Since this endpoint doesn’t seem to be the reason behind it, this app doesn’t exist on other devices I have here with the same connection error appearing.
Sorry I don’t quite follow, I thought this was an error you were seeing coming from your app? Why do you think it isn’t this endpoint, is your game calling it? How is the error appearing on other devices (what triggers it and how are you viewing the error). One note, you need to turn off local capture in Charles, we are only looking for network calls that you see when you launch your app on the device.
The Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_EXPIRE is appearing right after the game is launched. When tha game is open, there is the company splash logo, then an loading scene and then a menu where the user connects with his login. All the login process is validated through our site and online database, but before all that even starts the game fails to connect showing a message of connection error and when I debugged with adb the above error was displayed. We receive messages from different players reporting this issue before it appears on our tests devices. Then this morning I tested on a few devices and the Unity Editor, and the error only occured on the Android Devices with version below 8.0, all devices with 8.0 and above and the Unity Editor the game worked perfectly.
If you note in my message, that website is indeed returning Unknown Error, same as your screenshot. It looks like you are making a UnityWebRequest, are you calling that website or one of their services from your game? Their SSL certificate may be expired.
No, we don’t use that website, that is from an app that’s instaled by default on the device, and the others devices don’t have that app. I don’t know why that’s being called.
The link below is a test using the same build on other device. It has the same error on the app screen.
Please look for any endpoints that only your app is sending to. You should see them quickly appear in Charles as soon as you launch your app on the device. Are you using UnityWebRequest? How is the error appearing on the app screen? I thought it was in the logcat logs only. Are you writing errors to the UI? (which is a good debugging technique)
Yes, I’m using UnityWebRequest, and if the request fails it shows some messages on the game UI depending the type of the error. The error showing on the UI is the connection error, that shows when the request fails because of network error. After seeing the UI error I’ve done the adb debug and got the topic error on logcat.