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. Dismiss Notice

Feedback Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED

Discussion in 'Works In Progress - Archive' started by taeseong_park, Mar 18, 2021.

  1. taeseong_park

    taeseong_park

    Joined:
    Jul 24, 2020
    Posts:
    4
    Hi. I'm using Unity version 2020.1.6f1 and run on macOS Big Sur(11.2.3).

    My app is a mobile application running on Android & iOS.
    My app sends GET request to my client's server and get a result.
    - the domain of my client's server is "https://www.sejonghakdang.org/".

    It's been worked well until last month,
    but I noticed that it doesn't work on real Android and iOS devices as well as the Unity editor.

    error message is this:

    Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED


    but I tested with url "http://google.com", it's working

    I googled a lot of related things but got no luck.

    is my client's server domain is non-secure? please let me know why this happens.

    Here is my code below:

    Code (CSharp):
    1.     public static IEnumerator FetchGet(string uri, Action<string> action)
    2.     {
    3.         using (UnityWebRequest webRequest = UnityWebRequest.Get(uri))
    4.         {
    5.             // Request and wait for the desired page.
    6.             yield return webRequest.SendWebRequest();
    7.  
    8.             if (webRequest.isNetworkError)
    9.             {
    10.                 Debug.Log("Error: " + webRequest.error);
    11.                 action(null);
    12.             }
    13.             else
    14.             {
    15.                 Debug.Log("Received: " + webRequest.downloadHandler.text);
    16.                 action(webRequest.downloadHandler.text);
    17.             }
    18.         }
    19.     }
    Thanks in advance.
     
    Last edited: Mar 19, 2021