-
Bug
-
Resolution: Fixed
-
P4
-
7u45, 8
-
b132
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8183718 | 8u161 | Unassigned | P4 | Resolved | Fixed | b01 |
JDK-8164209 | 8u152 | Svetlana Nikandrova | P4 | Resolved | Fixed | b01 |
JDK-8192454 | emb-8u161 | Unassigned | P4 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]. Should also apply to other OS
A DESCRIPTION OF THE PROBLEM :
When using an http proxy (with -Dhttp.proxyHost) and specifying proxy exceptions (-Dhttp.nonProxyHosts) there is a bug when an entry in the list of nonProxyHosts is a duplicate.
The reason is in the code of sun.net.spi.DefaultProxySelector at line 265:
try {
while (st.hasMoreTokens()) {
pool.add(st.nextToken().toLowerCase(), Boolean.TRUE);
}
} catch (sun.misc.REException ex) {
}
If a duplicate item is added to the pool, an REException is thrown and silently discarded. Thus, all remaining items will not be added to the pool. A possible fix for this is, to add an additional paramter to the add method in line 265:
pool.add(st.nextToken().toLowerCase(), Boolean.TRUE, true);
This will skip the exception.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set nonProxyHosts with duplicate items. E.g.:
-Dhttp.nonProxyHosts=example.com|example.com|myproxyexception.com
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The domain myproxyexception.com should not be called through the proxy.
ACTUAL -
The domain myproxyexception.com is called through the proxy.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]. Should also apply to other OS
A DESCRIPTION OF THE PROBLEM :
When using an http proxy (with -Dhttp.proxyHost) and specifying proxy exceptions (-Dhttp.nonProxyHosts) there is a bug when an entry in the list of nonProxyHosts is a duplicate.
The reason is in the code of sun.net.spi.DefaultProxySelector at line 265:
try {
while (st.hasMoreTokens()) {
pool.add(st.nextToken().toLowerCase(), Boolean.TRUE);
}
} catch (sun.misc.REException ex) {
}
If a duplicate item is added to the pool, an REException is thrown and silently discarded. Thus, all remaining items will not be added to the pool. A possible fix for this is, to add an additional paramter to the add method in line 265:
pool.add(st.nextToken().toLowerCase(), Boolean.TRUE, true);
This will skip the exception.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set nonProxyHosts with duplicate items. E.g.:
-Dhttp.nonProxyHosts=example.com|example.com|myproxyexception.com
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The domain myproxyexception.com should not be called through the proxy.
ACTUAL -
The domain myproxyexception.com is called through the proxy.
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-8164209 Duplicate entry in http.nonProxyHosts will ignore subsequent entries
-
- Resolved
-
-
JDK-8183718 Duplicate entry in http.nonProxyHosts will ignore subsequent entries
-
- Resolved
-
-
JDK-8192454 Duplicate entry in http.nonProxyHosts will ignore subsequent entries
-
- Resolved
-
- duplicates
-
JDK-8169295 http.nonProxyHosts entries are ignored when it contains duplicates
-
- Closed
-
- relates to
-
JDK-8035158 Remove dependency on sun.misc.RegexpPool and friends
-
- Closed
-