1

I just can't get to work gradle with my corporate proxy. I got it to work though with node.js in the .npmrc file.

My password has a "<" character in the password. In the .npmrc file I had to escape it by writing "%3C" instead:

proxy=http://na_me:123%3C456@proxy.net:80/
https-proxy=http://na_me:123%3C456@proxy.net:80/

My gradle.properties look like this:

systemProp.http.proxyHost=proxy.net
systemProp.http.proxyPort=80
systemProp.http.proxyUser=na_me
systemProp.http.proxyPassword=123<456
systemProp.http.nonProxyHosts=localhost

systemProp.https.proxyHost=proxy.net
systemProp.https.proxyPort=80
systemProp.https.proxyUser=na_me
systemProp.https.proxyPassword=123<456
systemProp.https.nonProxyHosts=localhost

Is that syntax correct in theory? Or do I have to escape anything like the "<"?

I always get the error:

Error: Unable to tunnel through proxy. 
Proxy returns "HTTP/1.1 407 Proxy Authentication Required"

I tried using the global gradle.properties file in my user folder and also creating the file in C:\Program Files\Android\Android Studio\gradle.

Tornister
  • 177
  • 3
  • 14
  • I think it should be ok. The point is, you failed to state what your problem / error is. Do you get an error message? Does it just not use the proxy? ...? – Vampire Nov 30 '17 at 10:29
  • I totally forgot, I always get a 407 error: proxy authentication required. – Tornister Nov 30 '17 at 10:32
  • Afair with a wrong password it should be 401, so I'd say it is not a wrong password. Actually this is probably also not a Gradle problem, afair those properties are handled by core Java code and not by Gradle itself. – Vampire Nov 30 '17 at 10:40
  • It's weird, it looks like it won't even use the proxy settings. Do you have any suggestions what I could try? Android Studio has its own proxy settings, and they work perfectly. It's just gradle everytime. – Tornister Nov 30 '17 at 10:43
  • Start Wireshark and look at the network traffic? – Vampire Nov 30 '17 at 10:45
  • Did you find the solution to this by any chance? – Rahul P Dec 12 '18 at 04:52
  • I'm afraid I don't remember the solution to the whole proxy issue in the end. But I can tell you that the character escaping was not the issue. The syntax in my post is correct as posted. – Tornister Dec 12 '18 at 08:55

0 Answers0