Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Cert verify failed when trying to initialize new UGS

Discussion in 'Unity Analytics' started by Onygox, Jun 19, 2023.

  1. Onygox

    Onygox

    Joined:
    Apr 7, 2018
    Posts:
    2
    Hello,

    I'm trying to integrate the Analytics in Unity Gaming Services in Unity 2021.3.1f1 but when I try to initialize the service or send custom data I receive an error that reads "Curl error 60: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_USER_ERROR1" and no data is sent (according to my Dashboard).

    It's a multiplayer game using Steamworks, and I'm testing on a local connection in the Editor and in a Development Build, and I get the error in the Editor and in the Build.

    I tried updating the Editor to 2022.3.2f1 but while the error changed its wording ("Curl error 60 Certificate is not correctly signed by a trusted CA. UnityTls error code: 7"), it still appeared.

    Here's a small code sample from the project:

    Code (CSharp):
    1.  
    2. async void Start()
    3.     {
    4.         try
    5.         {
    6.             await UnityServices.InitializeAsync();
    7.  
    8.             List<string> consentIdentifiers = await AnalyticsService.Instance.CheckForRequiredConsents();
    9.  
    10.             StartCoroutine(SendFrameRateToServer());
    11.         }
    12.         catch (ConsentCheckException e)
    13.         {
    14.           // Something went wrong when checking the GeoIP, check the e.Reason and handle appropriately.
    15.           Debug.LogError(e.Reason);
    16.         }
    17.     }
    18.  
    19.     #region Frame Rate
    20.  
    21.     public IEnumerator SendFrameRateToServer()
    22.     {
    23.         while (true)
    24.         {
    25.             yield return new WaitForSeconds(60);
    26.  
    27.             int avgFrameRate = Mathf.RoundToInt((1.0f / Time.unscaledDeltaTime));
    28.  
    29.             Debug.Log("sending frame rate to server - " + avgFrameRate);
    30.  
    31.             // Send custom event
    32.             Dictionary<string, object> parameters = new Dictionary<string, object>()
    33.             {
    34.                 { PlayerAnalytics.FrameRateStatString, avgFrameRate }
    35.             };
    36.  
    37.             // The event will get queued up and sent every minute
    38.             AnalyticsService.Instance.CustomData("frameRate", parameters);
    39.         }
    40.     }
    41.  
    42.     #endregion
    43.  
    Can someone suggest a troubleshoot for this problem, and/or let me know what other information you need to get to the bottom of this?
     
  2. Onygox

    Onygox

    Joined:
    Apr 7, 2018
    Posts:
    2
    Update for those who find this thread with the same problem: I have fixed the issue. I have a VPN running on my wifi so Unity can't access its analytics servers through it. When I switched to a different wifi the error disappeared and the analytics events went through seamlessly.