Search Unity

Using Unity when behind a proxy

Discussion in 'Editor & General Support' started by GFX47, Dec 7, 2010.

  1. mimid212

    mimid212

    Joined:
    Mar 2, 2018
    Posts:
    1
  2. Grafmaiwalion

    Grafmaiwalion

    Joined:
    Apr 9, 2018
    Posts:
    1
    Depending on the companys setup this problem can also be solved by setting the correct proxy data in Internet Explorer, since Unity also looks for these settings. Changing the IE settings fixed it for me.

    After changing the proxy settings in IE restart your computer.
     
  3. KazYamof

    KazYamof

    Joined:
    Jun 26, 2015
    Posts:
    59
    I've set the environment variables, but...

    upload_2018-10-23_7-49-31.png
     
  4. KazYamof

    KazYamof

    Joined:
    Jun 26, 2015
    Posts:
    59
  5. Hotsun

    Hotsun

    Joined:
    Aug 11, 2010
    Posts:
    122
    It seems that only older Unity versions work with environment variables.
    I tested Unity 4.6 and it worked but from Unity 5 to 2018.3 it is not working.

    Unity 5.x and 2017.x and 2018.x on my laptop can connect without any environment variable but on my PC, these versions wont work with proxy at all.
     
    Last edited: Feb 11, 2019
  6. KCyeroRyu

    KCyeroRyu

    Joined:
    Oct 17, 2018
    Posts:
    1
  7. unix741lover

    unix741lover

    Joined:
    Mar 26, 2019
    Posts:
    1
  8. KazYamof

    KazYamof

    Joined:
    Jun 26, 2015
    Posts:
    59
    Still can't open Asset Store in Unity behind proxy. I setted the env. variables...

    Funny, I can open the Asset Store normally on my browser. So, it's not a network permission. Is Unity.

    Always says that I'm offline.

    upload_2019-4-12_9-22-12.png
     
  9. MikhaelMartin

    MikhaelMartin

    Joined:
    Sep 4, 2019
    Posts:
    7
    I tried the env variable solution. I could say it partly works. Now I could get the unity hub to download and install the unity editor. But inside the unity editor, asset store tells me that I'm offline.

    my proxy need authentication.
    windows 10
    unity hub 2.1
    unity editor 2019.2.2f1
     
  10. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,409
    since this thread is high on the google results, should note this new info:

    https://forum.unity.com/threads/offline-usage-of-unity-getting-harder.768023/#post-5115740
     
  11. BBTim

    BBTim

    Joined:
    Nov 11, 2019
    Posts:
    2
    I'm still having trouble getting Unity Hub to work with my proxy. I can't log in or add Unity installs through Hub. Both actions just return to the initial screen with no error message but also without any action performed. I noticed by using Process Explorer that the HTTP_PROXY and HTTPS_PROXY environment variables were not present in Unity Hub's process. What's more, there was a GOOGLE_API_KEY which seems to be related to Electron.

    Since Unity Hub does seem to be an electron app I tried adding a proxy to the command line by launching hub from cmd.exe and adding --proxy-server:my-proxy.com:port without http or https. If I include the protocol then I get errors on the update check and logging in or downloading installs still does not work. If I omit the protocol from the proxy url then the update check does not generate any errors but logging in or downloading installs still does not work. Logging in generates the error
    tunneling socket could not be established, cause=write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:c:\\projects\\electron\\vendor\\node\\deps\\openssl\\openssl\\ssl\\s23_clnt.c:797:
     
  12. BBTim

    BBTim

    Joined:
    Nov 11, 2019
    Posts:
    2
    This was quite the rabbit hole, but I solved it for my case. The solution was setting the HTTP_PROXY and HTTPS_PROXY environment variables as the documentation says. What is doesn't say there is that counter intuitively the protocol for the proxy should be http, not https. I didn't even want to try this at first since it seems just wrong but fora for other Electron apps mentioned it so many times that i tried it anyway. So on the command line use:
    set HTTPS_PROXY=http://proxy-url:port

    Yes, that is setting the httpS proxy to an http (not-s) address. You can also set it in your environment variable editor accordingly.

    Once I had done that the problem moved to SSL and I found this error in the logs:
    self signed certificate in certificate chain\n\tstack Error: self signed certificate in certificate chain\n <more stuff....>

    This is caused by the proxy signing all packets with its own certificate. Unless you find a way to tell your applications that these certificates are trusted this looks like a man-in-the-middle attack and the connection is refused. If you happen to have *.pem file you should use an environment variable to point to that.
    set NODE_EXTRA_CA_CERTS=yourfile

    But if you don't you can disable this check. You should understand that doing so will make secure connections vulnerable to actual man-in-the-middle attacks. Keeping that in mind you can disable the check like this:
    set NODE_TLS_REJECT_UNAUTHORIZED=0


    After that I was able to log in to Unity Hub. It still can't download new installs but I can download offline installers for that.