-
Bug
-
Resolution: Fixed
-
P2
-
1.4.2_10, 6u10
-
b89
-
x86, sparc
-
linux, solaris_7, windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2154579 | 6u10 | Chris Hegarty | P2 | Resolved | Fixed | b20 |
JDK-2190715 | OpenJDK6 | Chris Hegarty | P3 | Resolved | Fixed | b19 |
JDK-2154580 | 5.0-pool | Robert Mckenna | P3 | Closed | Duplicate | |
JDK-2154624 | 1.4-pool | Abhijit Saha | P2 | Closed | Cannot Reproduce | |
JDK-2168768 | 1.4.2_19 | Abhijit Saha | P3 | Resolved | Fixed | b01 |
JDK-2163432 | 1.4.2_18-rev | Abhijit Saha | P2 | Resolved | Fixed | b07 |
The JDK versions mentioned below are versions of a Java Licensees JDK implementation and do not map directly to Sun's JDK versions. This problem was first seen
to happen between versions 1.4.2.10 and 1.4.2.11 of the licensees JDK implementation. In this implementation 1.4.2.10 maps to Sun release 1.4.2.09; 1.4.2.11 maps to Sun release 1.4.2.12. That means it might have changed in Sun's release 1.4.2.10, 1.4.2.11 or 1.4.2.12. In actual fact, we believe that this problem first occurred in 1.4.2_13 and 5.0 or greater.
--------------------------------
The issue in question is that there appears to be a change in behavior between 1.4.2.10 and 1.4.2.11
(and 1.5.*) with HTTPS URL connections. It now requires the properties https.proxyHost and https.proxyPort to be defined. However, these properties were not required in 1.4.2.10 and earlier; if the
user defines the SSLSocketFactory. Using setSSLSocketFactory allows load balancing across several proxies instead of a single property value.
if (myConnection instanceof com.sun.net.ssl.HttpsURLConnection) {
((com.sun.net.ssl.HttpsURLConnection)
myConnection).setSSLSocketFactory(new SSLTunnelSocketFactory
(System.getProperty("proxyHost"), System.getProperty("proxyPort")));
}
Simple reproducer can be found at:
http://forum.java.sun.com/thread.jspa?threadID=172539
While this example works "as is" with all java versions, if you
comment out the following section:
//set up system properties to indicate we are using a proxy
System.setProperty("https.proxyHost", proxyHost);
System.setProperty("https.proxyPort", proxyPort);
It will fail with 1.4.2.11 or higher. it also fails on Windows, Linux, and OpenVMS.
I believe (however without the source for JSSE it is hard to tell
exactly) the change can be found in the class "HttpsClient" with the
doConnect method:
Decompile doConnect() method from 1.4.2.11
protected Socket doConnect(String s, int l)
throws IOException, UnknownHostException
{
d = d == null ? getProxyHost() : d;
e = e == 0 ? getProxyPort() : e;
Socket socket = null;
if(d == null || k())
{
socket = new Socket();
if(NetworkClient.defaultConnectTimeout > 0)
socket.connect(new InetSocketAddress(s, l),
NetworkClient.defaultConnectTimeout);
else
socket.connect(new InetSocketAddress(s, l));
} else
{
try
{
socket = (Socket)AccessController.doPrivileged(new Object() /* anonymous class not found */
class _anm2 {}
);
}
catch(PrivilegedActionException privilegedactionexception)
{
throw (IOException)
privilegedactionexception.getException();
}
catch(IOException ioexception)
{
try
{
socket = new Socket();
if(NetworkClient.defaultConnectTimeout > 0)
socket.connect(new InetSocketAddress(s, l),
NetworkClient.defaultConnectTimeout);
else
socket.connect(new InetSocketAddress(s, l));
}
catch(IOException ioexception1)
{
throw ioexception;
}
}
}
if(NetworkClient.defaultSoTimeout > 0)
socket.setSoTimeout(NetworkClient.defaultSoTimeout);
return socket;
}
Same code from 1.4.2.10, notice it honors the user defined
SSLSocketFactory after checking to see https.proxyHost has been
defined...
protected Socket doConnect(String s, int j)
throws IOException, UnknownHostException
{
d = d == null ? getProxyHost() : d;
e = e == 0 ? getProxyPort() : e;
Object obj = null;
SSLSocketFactory sslsocketfactory = c;
if(d == null || i())
obj = sslsocketfactory.createSocket(s, j);
else
try
{
obj = (Socket)AccessController.doPrivileged(new
PrivilegedExceptionAction() {
public Object run()
throws IOException
{
Socket socket = new Socket();
if(HttpsClient.e() > 0)
socket.connect(new InetSocketAddress
(HttpsClient.a(a), HttpsClient.b(a)), HttpsClient.f());
else
socket.connect(new InetSocketAddress
(HttpsClient.a(a), HttpsClient.b(a)));
return socket;
}
private final HttpsClient a; /* synthetic field */
});
}
catch(PrivilegedActionException privilegedactionexception)
{
throw (IOException)
privilegedactionexception.getException();
}
catch(IOException ioexception)
{
try
{
obj = (SSLSocket)sslsocketfactory.createSocket(s,
j);
}
catch(IOException ioexception1)
{
throw ioexception;
}
}
return ((Socket) (obj));
}
This change broke the customer's application. As a workaround they
might be able to implement the https.proxyHost property; however they
believe they have several proxies that the application might load
balance across. This can not be done by setting a single
https.proxyHost property.
- backported by
-
JDK-2154579 HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
-
- Resolved
-
-
JDK-2163432 HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
-
- Resolved
-
-
JDK-2168768 HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
-
- Resolved
-
-
JDK-2190715 HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
-
- Resolved
-
-
JDK-2154624 HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
-
- Closed
-
-
JDK-2154580 HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
-
- Closed
-
- duplicates
-
JDK-6679397 Regression test sun/net/www/protocol/https/HttpsURLConnection/HttpsSocketFacTest.java failed on win
-
- Closed
-
- relates to
-
JDK-6634730 sanity/pluggability/CheckExport.java failed against 1.4.2_18 ea b04 in jsse testing
-
- Resolved
-
-
JDK-6766775 X509 certificate hostname checking is broken in JDK1.6.0_10
-
- Resolved
-
-
JDK-6771432 createSocket() - smpatch fails using 1.6.0_10 because of "Unconnected sockets not implemented"
-
- Resolved
-
-
JDK-6432143 sun.net.client.defaultConnectTimeout defaultReadTimeout should work with HttpsURLConnection
-
- Resolved
-
-
JDK-2190716 createSocket() - smpatch fails using 1.6.0_10 because of "Unconnected sockets not implemented"
-
- Resolved
-
-
JDK-2190717 X509 certificate hostname checking is broken in JDK1.6.0_10
-
- Resolved
-