Closed Bug 106145 Opened 24 years ago Closed 24 years ago

Trying to create an ssl socket and limit the setup connection time

Categories

(JSS Graveyard :: Library, defect)

3.1.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jamie-bugzilla, Assigned: jamie-bugzilla)

Details

****BUG IMPORTED FROM NETSCAPE INTERNAL BUG DATABASE*** I need to re-evaluate this to see whether it is still an issue. ************************** This case stems from the customer's question: In JSS, the SSLSocket class: how does one create an SSLSocket and limit the time it takes to setup the connection? (Like in NSS where there is a timeout parameter in PR_Connect). The customer tried the setSoTimeout method, but it did not work. Customer states: I just realized after reading the JSS doc again that SSLSocket does NOT use the setSoTimeout to limit the setup connection time but the SSLServerSocket does use setSoTimeout to limit the time to accept a connection. Note that NSS also provides a way to limit the connection setup time. It would be nice to have that same capability in JSS. I think both capabilities are important: to provide the client with the ability to limit the connection setup time so client apps don't hang, as well as to provide the server with the capability to limit the accept connection time. So instead of trying to use the setSoTimeout with an ServerSocket, I used it with an SSLServerSocket but that does not seem to limit the accept connection time! See the sample server code below: my server blocks at the accept() but does NOT time out after the 2 seconds. It looks like a bug. Here is my code sample to use to file a defect with Engineering: // ---- Begin server code sample ---- SSLServerSocket l = null; SSLSocket s = null; try { // Limit accept connection time to 2 seconds. l.setSoTimeout(2000); System.out.println("Accept connection timeout is " + new Integer(l.getSoTimeout()).toString()); s = (SSLSocket)l.accept(); s.forceHandshake(); } catch (SocketException se) { throw (new SecurityException("Error accepting a connection from " + s.getInetAddress.().getHostAddress())); } // ---- End server code sample ----
Did I screw up the cut-and-paste, or did mozilla? I think I'll try that again.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
lovely summary :p dupe of bug 106145
Summary: but it did not work.Customer states:I just realized after reading the JSS doc again that SSLSocket does NOT usethe setSoTimeout to limit the setup connection time but the SSLServerSocketdoes use setSoTimeout to limit the time to accept a connection.Note f… → Trying to create an ssl socket and limit the setup connection time
You need to log in before you can comment on or make changes to this bug.