JDK-6668261 : Appli. hangs because SSLSocket in Client side can not be closed
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 5.0u14
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-02-27
  • Updated: 2010-09-29
  • Resolved: 2008-03-01
Related Reports
Relates :  
Description
Server and client applications using SST/TLS communication hangs
because SSLSocket.close() can not close SSLSocket in CLient side.
This is very similar to 6447412, but the attached program still  hangs in 5.0u14
which should includes the fix for 6447412.

REPRODUCE :
1) unfold the sttached file. 
You will see a folder, "ssl_write_close". 
2) Open 2 command prompt windows
   The following should be done in each command prompt windows.
   - Go to ssl_write_close and 
        Set JDK_PATH to the full path name to JDK5.0u14
4) Invoke "Server.bat" in a command prompt and then invoke "Cilent.bat"
    in another window.

CONFIGURATION:
 OS   : Windows XP(SP2, Japanese)
 JDK : 5.0u14

Comments
EVALUATION If a large amount of data write to peer, and the peer doesn't read it on time, the SSL socket output stream will be blocked if the output buffer full filled, and then the close_notify will not be able to send to peer any more until the output buffer free. That's the expected behaviours. If application wanna always close the socket even if the buffered data doesn't send to peer completely, they should use SO_LINGER, which will affects the socket close timeout. In the attached case, if client set sslSocket.setSoLinger(true, timeout-seconds), the close_notify will not send to peer, but the socket will closed if linger timeout.
01-03-2008