This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245490 - Unable to connect to update center from behind company firewall, regardless of using system proxy settings or manual proxy settings
Summary: Unable to connect to update center from behind company firewall, regardless o...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Proxy (show other bugs)
Version: 8.0
Hardware: PC Windows 7 x64
: P3 normal with 2 votes (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-08 14:21 UTC by Stefan.S
Modified: 2016-07-08 06:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Netbeans message log (3 files ziped) (52.00 KB, application/x-zip-compressed)
2014-07-08 14:21 UTC, Stefan.S
Details
.pac file used for automatic prox configuation (769 bytes, text/plain)
2014-07-11 10:21 UTC, Stefan.S
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan.S 2014-07-08 14:21:02 UTC
Created attachment 147939 [details]
Netbeans message log (3 files ziped)

I'm trying to configure access to the plugin update center from behind a company firewall.
System proxy configuration is done via an automatic configuration script (.pac).

Setting the option "Use System Proxy Settings" results in a "connection timed out" when trying to "Check for Updates" and when using the "Test connection" button in the proxy configuration.

Setting the option "Manual Proxy Setting" to the apropriate values results in either in a hanging "Test connection" action, or in a timeout when trying to "Check for Updates". I checked the settings twice, together with our network administrators.

The proxy server in use here is "Microsoft Internet Security and Acceleration (ISA) Server" and I need to authenticate against this server. I've tried to provide the user name alone and the domain\username variant, without success of any.

Looking at the netbeans message log brings some suspicion, because regardless of using system proxy or manual proxy configuration the log always shows that the ide is resolving the automatic configuation script (.pac)

INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy resolver: Windows
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi@3.8.0.v20120529-1548 started
INFO [org.netbeans.core.network.proxy.windows.WindowsNetworkProxy]: Windows system proxy resolver: auto - PAC (http://sr1034/proxy/meer.pac)
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading succeeded.
INFO [org.netbeans.core.network.proxy.ProxyAutoConfig]: findProxyForURL(http://netbeans.org) returns null.
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - mode: auto
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - pac url: http://sr1034/proxy/meer.pac
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy TEST - http host: 
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy TEST - http port: 0

In the attached message log you should find trys with both options, "System proxy setting" and "Manual proxy settings". I stated the ide using the following commandline, as I found in some older bug reports (although I doubt that setting a finer log level to the ant module helps in this case):
"c:\Program Files\NetBeans 8.0\bin\netbeans64.exe" -J-Dorg.apache.tools.ant.module.level=0

I would apreciate your help, whether it's my configuration fault or a bug.
And don't hesitate to contact me if other resources than the message.log are helpful.
Comment 1 Stefan.S 2014-07-11 10:21:30 UTC
Created attachment 147994 [details]
.pac file used for automatic prox configuation
Comment 2 Stefan.S 2014-07-11 10:22:45 UTC
I've done some additional research on this issue.
1) Regardless of choosing "Use System Proxy Settings" or "Manual Proxy Settings" in "Tools | Options | General" the NetBeans IDE seems to always load the system proxy settings, which in my case is an automatic configuraiton script (.pac).
2) Reloading system proxy settings via the "Reload" button in "Tools | Options | General" has no effect. If I change the proxy defined in the .pac file and then reload, the message.log still shows the old proxy in the messages related to this reload.
3) When resolving the proxy via the function findProxyForURL(url, host) of the .pac file, null is returned for URLs to the following hosts: netbeans.org, updates.netbeans.org, plugins.netbeans.org, dlc.sun.com.edgesuite.net; although my .pac file works perfectly when accessing these URLs via my Web-Browser.
After adding the lines below as the first lines in the function findProxyForURL(url, host) and restarting the ide the correct proxy is returned. I uploaded our default .pac file as attachment.

if (shExpMatch(host,"netbeans.org")) {return "PROXY vs0016.sms-meer.int:8080; DIRECT";}
if (shExpMatch(host,"updates.netbeans.org")) {return "PROXY vs0016.sms-meer.int:8080; DIRECT";}
if (shExpMatch(host,"plugins.netbeans.org")) {return "PROXY vs0016.sms-meer.int:8080; DIRECT";}
if (shExpMatch(host,"dlc.sun.com.edgesuite.net")) {return "PROXY vs0016.sms-meer.int:8080; DIRECT";}

message log before adding above lines to function findProxyForURL(url, host):
INFO [org.netbeans.core.network.proxy.windows.WindowsNetworkProxy]: Windows system proxy resolver: auto - PAC (file://D:/stroeste/dev/Tools/meer-test.pac)
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading succeeded.
INFO [org.netbeans.core.network.proxy.ProxyAutoConfig]: findProxyForURL(http://netbeans.org) returns null.
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - mode: auto
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - pac url: file://D:/stroeste/dev/Tools/meer-test.pac
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy TEST - http host: 
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy TEST - http port: 0

message log before adding above lines to function findProxyForURL(url, host):
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy resolver: Windows
INFO [org.netbeans.core.network.proxy.windows.WindowsNetworkProxy]: Windows system proxy resolver: auto - PAC (file://D:/stroeste/dev/Tools/meer-test.pac)
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading succeeded.
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - mode: auto
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - pac url: file://D:/stroeste/dev/Tools/meer-test.pac
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy TEST - http host: vs0016.sms-meer.int
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy TEST - http port: 8080

4) Although I generally get connetion with the above changes to findProxyForURL(url, host), I get a lot of connection timeouts. I have to admit the our internet connection is generally not the fastest if a lot of coworkers access the internet at the same time, but the timeout value seems to be very low, since I also get timeouts when connecting via my private 6mbit DSL line at home.
So I'd like to have a place where I can increase the apropriate timout value.

Concluding there are 4 issues :
- Choosing "Manual Proxy Settings" option in "Tools | Options | General" has no effect
- Reload of system proxy settings is not working properly
- Evaluation of function findProxyForURL(url, host) does not return expected results
- Low timout threshold value for http connections
Comment 3 phansson 2014-09-06 19:46:32 UTC
Stefan,

There are a number of problems with the existing ProxySelector implementation in NetBeans, in particular when used with auto-config (i.e. PAC file) or auto-discovery (aka WPAD).

I would recommend taking a look at this long explanation of what are the current issues and their resolution.
(https://bitbucket.org/phansson/netbeansproxy2)

Ultimately I would recommend installing this Plugin in your IDE:
http://plugins.netbeans.org/plugin/55258/proxyselector-v2. It is a drop-in replacement for the existing ProxySelector so there's really nothing you need to do except install it. See if that fixes your issues.

Ok, the term (and class) in Java called ProxySelector is about figuring out WHICH proxy. You also raise the question about proxy authentication which is another issue altogether. Java is actually pretty good at doing auto-authentication against proxies without the developer having to do anything. You say your site uses a Microsoft proxy. My guess is that this proxy uses silent NTLMv2-based authentication. Here's the thing: If this is true there's nothing in terms of authentication you need to configure anywhere because Java, not NetBeans, does it for you behind the scenes. I've raised an RFE (bug 245192) on this topic in order to clarify that you only need to configure proxy authentication username and password in the NetBeans IDE if your proxy requires EXPLICIT authentication. Pretty sure your proxy uses some form of IMPLICIT authentication scheme which means there's nothing for you to specify.

All in all I would recommend installing said plugin and then reset all the proxy configuration in your IDE you may have done back to their defaults. The only thing you *may* have to configure is the location of your PAC file .. unless your site uses WPAD. (in my experience most corporate sites uses WPAD)


I hope this clarifies things and makes you progress your issue.
Comment 4 Stefan.S 2014-09-16 12:23:26 UTC
@phansson
After reading your long explanation (https://bitbucket.org/phansson/netbeansproxy2) it's clear that our configuration script (the PAC file) fails because it also contains a call to isInet().

Our company does not use WPAD. Almost all clients in our network are microsoft windows machines and the proxy configuration is done via microsofts "internet options" settings where the URL of the PAC file is inserted.

Installing the http://plugins.netbeans.org/plugin/55258/proxyselector-v2 plugin solved this issue.
hopefully this will find it's way into the netbeans distribution some day.
Comment 5 rjdkolb 2016-07-08 06:58:39 UTC
netbeansproxy2 , fixed my issue of being behind a transparent proxy and Netbeans continually locking up.

Netbeans 8.1
Java 1.8.0_92
Ubuntu