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

Bug UnityWebRequest SSL CA Certificate Error

Discussion in 'Android' started by compy14, Sep 29, 2022.

  1. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Hello, first of all I would like to say that I have already tried a lot of the code that is in the forum, otherwise I would not be writing.

    In my case we have a game that uses UnityWebRequest, and recently we had to update from 2019.4.28 to 2020.3.38, because Google asked us to update the new Billing and we had no choice, we don't like having to update due to bad experiences, and that it always lowers the performance of the game when we do it.

    Well, I have a player (I don't know if there will be more, but we've only received one), who has gone from having the UnityWebRequest work to not working(so in 2019 its working and in 2020 not working). Basically it is the first request that is made of the game to know if the player has the version that he plays and send it to the store if he needs it.

    We have tried different things, forcing the certificate to be accepted, renewing our certificate, adding in the manifest that the site is trusted... And nothing has worked. This user has a Samsung Galaxy Cricket (which are the A, he has not been able to specify)

    I add some code:

    Code (CSharp):
    1. WWWForm form = new WWWForm();
    2.  
    3. form.AddField("version", app_version);
    4. form.AddField("platform", platform);
    5.  
    6. UnityWebRequest w = UnityWebRequest.Post(URL + "initcode.php", form);
    7.  
    8. yield return w.SendWebRequest();
    9.  
    10. if (!string.IsNullOrEmpty(w.error))
    11. {
    12.    //The code enters here
    13. } else
    14. {
    15.  
    16. }
    17.  
    18.      
     
  2. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Hello? Some help? It would be good since we have been paying for years, if at least someone from support answered me.
     
  3. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,638
    This error means the server is not trusted. Probably root certificate is not in device certificate store.
    The way around it is to connect custom certificate handler and manually validate the server.
     
  4. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Thanks for the answer. Do you have any example code? Because we already tried that, and it didn't work for us, so it's either the solution or we didn't implement it well. Oh and the certificate we use is the one from Amazon. The thing is that with the 2019 version there were no problems.
     
    Last edited: Sep 29, 2022
  5. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Hello? A little more support please from the Unity experts, we have been paying for this engine for 4 years, without asking for anything and one day you have a serious error because of the engine and you don't answer me. We have tried everything possible within the forum and it has not worked. The error arose from upgrading from Unity 2019.4.28 to Unity 2020.3.38.
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,638
    If it does work with 2019.4, but not with later Unity, please make a small project to reproduce it and report a bug for it. We have to look inside what's going on.
     
  7. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
  8. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,638
    Could you report it as bug using Unity Editor, so it goes the proper channel?
    Thanks.
     
  9. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Great!Thanks, Reported, we waiting for response!
     
  10. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Hello! I update the post to comment that rolling back to version 2020.3.28 works correctly, quite sure it is this point that causes "Core: Updated libcurl to 7.80" to fail. We are obliged to stay in this version but could it solve the problem for future updates?
     
  11. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,638
    That's one possibility. Have you tried the latest version, cause I think we had upgraded curl even further.
     
  12. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    We tried version 2020.3.40 and it didn't work. I confirm that with wifi it works but with data it does not. And with version 2020.3.28 it works correctly.
     
  13. compy14

    compy14

    Joined:
    Aug 9, 2015
    Posts:
    20
    Hello, we already have the bug fixed for a few weeks by going down to 2020.3.28, but I would like to know if there is a forecast that it will be fixed in future versions. also send the error