(How) Is it possible to set a connection timeout for a JSS SSLSocket?
http://www.mozilla.org/projects/security/pki/jss/javadoc/org/mozilla/jss/ssl/SSLSocket.html

None of the constructors have a connection timeout and SSLSocket.setSoTimeout(int timeout) can only be called *after* creating the socket so I'm assuming it functions as a read/write timeout.

From testing it appears it's using a 30 second timeout, I just have no idea where it's getting this value from and if/how I can change it.

Opening connection: Wed Feb 18 11:03:31 EST 2009
Exception:          Wed Feb 18 11:04:01 EST 2009
java.net.SocketTimeoutException: Unable to connect: (-5990) I/O operation timed out.
        at org.mozilla.jss.ssl.SSLSocket.socketConnect(Native Method)
        at org.mozilla.jss.ssl.SSLSocket.<init>(SSLSocket.java:265)
        at org.mozilla.jss.ssl.SSLSocket.<init>(SSLSocket.java:236)
        at org.mozilla.jss.ssl.SSLSocket.<init>(SSLSocket.java:180)

The native method socketConnect is defined here:
http://mxr.mozilla.org/security/source/security/jss/org/mozilla/jss/ssl/SSLSocket.c#457

and down on line 501 appears to be the actual connect call:
http://mxr.mozilla.org/security/source/security/jss/org/mozilla/jss/ssl/SSLSocket.c#501
 status = PR_Connect(sock->fd, &addr, PR_INTERVAL_NO_TIMEOUT);

PR_INTERVAL_NO_TIMEOUT is defined here:
http://mxr.mozilla.org/security/source/nsprpub/pr/include/prinrval.h#83

Logically, no timeout would mean no timeout...so where does 30 seconds come into play? Is NSPR getting some value from my OS and using it?

Thanks,
Dave
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to