Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Delay in SSL socket connection?

Reply
Thread Tools

Delay in SSL socket connection?

 
 
Rick Genter
Guest
Posts: n/a
 
      11-07-2003
I'm having a problem with an SSL socket connection taking a long time
to complete. I am using J2SE 1.4.2 and using the JSSE package included
therein. My code is lifted straight from the tutorials on how to use
JSSE. The problem I am facing boils down to the fact that the line of
code:

Socket socket = factory.createSocket(host, port);

typically takes 4.5 seconds to execute. This is between two machines
communicating over the Internet with a typical ping time of 30
milliseconds. Other (non-SSL) socket connections in the same
application between the same two machines are taking < 100
milliseconds. Occasionally the above line of code takes much LONGER to
execute; I've seen it take as long as 23 seconds.

Can anyone point me in a direction to try to improve the performance
of my application in this regard? Thanks.


Rick
 
Reply With Quote
 
 
 
 
Ronny Schuetz
Guest
Posts: n/a
 
      11-08-2003
Hi,

I guess you're validating the certificates for the SSL connection. Try
to write a custom Trustmanager for JSSE that caches validation results
for some time in memory, so that at least opening connection to the
same peer gets faster. For the initial connection, you cannot do much
probably.

Ciao,
Ronny

--
+----------------------------------+---------------------------------+
| Ronny Schuetz | Phone : +49-7031-14-4714 |
| Hewlett-Packard GmbH | Fax : +49-7031-14-2221 |
| Boeblingen / Germany | Telnet : 777-4714 |
| Enterprise Integration Solutions | Voicemail: 1392.1144714 |
| Platform Services | email : http://www.velocityreviews.com/forums/(E-Mail Removed) |
+----------------------------------+---------------------------------+

 
Reply With Quote
 
 
 
 
EJP
Guest
Posts: n/a
 
      11-09-2003
You don't really need to do this as long as you keep using the same
SSLSession, which is what happens by default.

Ronny Schuetz wrote:
>
> Hi,
>
> I guess you're validating the certificates for the SSL connection. Try
> to write a custom Trustmanager for JSSE that caches validation results
> for some time in memory, so that at least opening connection to the
> same peer gets faster. For the initial connection, you cannot do much
> probably.
>
> Ciao,
> Ronny
>
> --
> +----------------------------------+---------------------------------+
> | Ronny Schuetz | Phone : +49-7031-14-4714 |
> | Hewlett-Packard GmbH | Fax : +49-7031-14-2221 |
> | Boeblingen / Germany | Telnet : 777-4714 |
> | Enterprise Integration Solutions | Voicemail: 1392.1144714 |
> | Platform Services | email : (E-Mail Removed) |
> +----------------------------------+---------------------------------+

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM
IO::Socket::SSL : $sock is not defined if client is not SSL (crash) sgt_b2002@yahoo.com Perl Misc 1 12-19-2005 07:36 PM
Python SSL Socket Client to Java SSL Server. HELP me PLEASE. Krzysztof Paź Python 1 09-26-2003 08:36 PM



Advertisments