JDK-6432143 : sun.net.client.defaultConnectTimeout defaultReadTimeout should work with HttpsURLConnection
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 1.4.2_01
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-05-31
  • Updated: 2011-02-16
  • Resolved: 2006-06-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
1.4.2_13 b01Fixed 6-poolResolved
Related Reports
Relates :  
Relates :  
Description
HttpsURLConnection doesn't set the DefaultReadTimeout and DeafultConnectTimeout properties. Where as user can set these properties in the HttpURLConnectio. This behaviour is different from the Http based application.

java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

FULL OPERATING SYSTEM VERSION :
SunOS bem 5.8 Generic_108528-17 sun4u sparc SUNW,Netra-T4

ADDITIONAL OPERATING SYSTEMS :
Windows 2000 Professional



A DESCRIPTION OF THE PROBLEM :
The sun.net.client.defaultConnectTimeout and
sun.net.client.defaultReadTimeout timeouts do not appear to
work when using HTTPS connections.



REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
System.setProperty("sun.net.client.defaultConnectTimeout",
                   "1000");
System.setProperty("sun.net.client.defaultReadTimeout",
                   "2000");

/* Ensure connection will timeout before running */
URL mysite = new URL("https://www.verisign.com");

URLConnection mysite = url.openConnection();


---------- END SOURCE ----------

Comments
SUGGESTED FIX HttpsClient's doConnect overrides the NetworkClient's doConnect, and thus doesn't respect the properties. This function shouldn't use createSocket to create the socket. It should call the socket constructor and then setting the DefaultConnectTimeout and DefaultReadTimeout properties.
31-05-2006

EVALUATION Submitter is correct, HttpsClient's doConnect overrides the NetworkClient's doConnect, and thus doesn't respect the properties.
31-05-2006